Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
Inside the main() function with java.util.Scanner imported: int[] arr = new int[5]; for (int i = 0; i < 5; i++) { System.out.print("Enter a number: "); Scanner raw_in = new Scanner(System.in); art[i] = raw_in.nextInt(); } This code will allow 5 numbers to be inputted and stored.
25th Oct 2017, 1:20 AM
LunarCoffee
LunarCoffee - avatar