- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenRandomNum.java
More file actions
Latest commit
20 lines (18 loc) · 665 Bytes
/
Copy pathgenRandomNum.java
File metadata and controls
20 lines (18 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
importjava.util.*;
classgenRandomNum {
publicstaticvoidmain(String[] args) {
Scannersc=newScanner(System.in);
System.out.println("How many random number you want? ");
intn = sc.nextInt();
System.out.println("Range from which random number you want? ");
intrange = sc.nextInt();
Randomrnum = newRandom();
System.out.println("Random Numbers:");
System.out.println("***************");
for (intcounter = 1; counter <= n; counter++) {
System.out.println(rnum.nextInt(range));
}
System.out.println("***************");
sc.close();
}
}