You are on page 1of 1

AmanJamwal — Today at 09:07

// Online Java Compiler


// Use this editor to write, compile and run your Java code online
import java.util.Scanner;
import java.util.Random;
class RandomNum {
public static void main(String[] args) {
int rand_num;
Scanner Sc=new Scanner(System.in);
Random rand=new Random();
System.out.println("Enter the size :");
int a=Sc.nextInt();
for(int i=0;i<a;i++){
rand_num=rand.nextInt(9);
System.out.print(rand_num);
}

}
}

You might also like