Computer Science, asked by shiv2131, 11 months ago

How to read data from scanner to an array in java?

Answers

Answered by amannishad0512p5zxh6
0

It is done in such a way

Scanner sc=new Scanner (System.in);

int a[]=new int[10];

for (int i=0;i<a.length;i++)

{

a[i]= sc.nextInt();

}

Now you got@

for more java doubts ,follow me

Similar questions