import java.util.Random;
import java.util.Scanner;
public class RandomNumbers {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("enter max range: ");
int max=sc.nextInt();
Random ran=new Random();
for(int i=0;i<=10;i++) {
System.out.println(ran.nextInt(max));
}
}
}
Output:
enter max range:
5
0
0
0
1
3
0
4
4
4
4
2