Thursday, November 21, 2013

Random counding number programe in java

import java.util.Random;
public class QuickRandom {
    public static void main(String[] args) {
      System.out.println("The following is a list of 100 random" +
              " 3 digit numbers.");
      Random rand= new Random();
     
     
      for(int i=0;i<100;i++)
      {     
          int pick = rand.nextInt(900) + 100;
          System.out.println(pick);
         
          int sum = 0;
         
          sum += pick + pick;
         
          System.out.println("The sum is: " + sum + ".");
        }
  
    }
   
}
   
   

No comments:

Post a Comment