- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandomNumber.java
More file actions
Latest commit
23 lines (16 loc) · 589 Bytes
/
Copy pathRandomNumber.java
File metadata and controls
23 lines (16 loc) · 589 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importjava.util.Scanner;
importjava.util.Random;
publicclassRandomNumber {
publicstaticvoidmain(String[] args) {
Randomrd = newRandom();
Scannersc = newScanner(System.in);
intlen,i,randnum;
System.out.print("How Many Random Numbers You want to Generate ? ");
len = sc.nextInt();
System.out.print("\nGenerating " + len + " Random Numbers in the range 0...999 \n");
for(i = 0; i< len; i++){
randnum = rd.nextInt(1000);
System.out.println(randnum + " ");
}
}
}