JAVA PROGRAM TO GENERATE RANDOM NUMBERS USING RANDOM CLASS

import java.util.*;

class RandomNumbers
{
    public static void main(String [] args)
    {
       int c;
        Random tr= new Random();
        for (c = 1;c <= 10;c++)
          {
             System.out.print(tr.nextInt(100) );
           }
    }
}

SAMPLE OUTPUT:

No comments:

Post a Comment