fork download
  1. import java.util.Scanner;
  2.  
  3. class MathDemo {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. //User Input of limit of cycles
  8. Scanner input = new Scanner(System.in);
  9. System.out.println("How many Random number do you want?(Enter Number 1-10)");
  10. int limit;
  11. limit = input.nextInt();
  12.  
  13. //For loop runnin guser input
  14. for (int counter = 0; counter < limit; counter++) {
  15. double random = Math.random() * 10;
  16. System.out.println("Random number:" + random);
  17. }
  18. // print the numbers and print the higher one
  19. System.out.println("Your Limit number Entered was:" + limit);
  20. }
  21. }
Success #stdin #stdout 0.07s 712704KB
stdin
7
stdout
How many Random number do you want?(Enter Number 1-10)
Random number:0.2370624704186175
Random number:1.788084238368578
Random number:2.2045471715607636
Random number:5.027548002715395
Random number:0.6700084580834842
Random number:1.7763334937972186
Random number:1.058443693545802
Your Limit number Entered was:7