0
How to get element of the array from user?
any example
2 Answers
+ 3
for(int i = 0; i < array.length; i++)
array[i] = sc.nextInt();
sc is an instance of the Scanner class. You can variably use any other Scanner methods (nextLine(), etc.) depending on the code requirements.
0
Initialize an array, read the user input and assign its value to a given position in the array...