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.  
  11. //For loop runnin guser input
  12. for (int counter = 0; counter < input; counter++) {
  13. double random = Math.random() * 10;
  14. System.out.println("Random number:" + random);
  15. }
  16. // print the numbers and print the higher one
  17. System.out.println("Your Limit number Entered was:" + input);
  18. }
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5
compilation info
Main.java:12: error: bad operand types for binary operator '<'
    		for (int counter = 0; counter < input; counter++) {
    		                              ^
  first type:  int
  second type: Scanner
1 error
stdout
Standard output is empty