Posted By

karellism on 04/22/13


Tagged

math random generator For-loop


Versions (?)

Random number generator


 / Published in: Java
 

A random number generator using a for-loop.

  1. int randomValue = 0;
  2.  
  3. for (int i = 0; i < 10; i++) {
  4. randomValue = (int) (Math.random() * 10);
  5.  
  6. System.out.println("Random No " + i + ". " + randomValue);
  7. }

Report this snippet  

You need to login to post a comment.