0
What is error in this?
import java.util.*; class Ans{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int[] z = new int[10]; for(int i = 0;i<z.length;i++){ System.out.println("Print the value of z["+i+"]"); z[i] = s.nextInt(); } for(int i = 0;i<z.length;i++){ System.out.println("The value of z["+i+"] is "+z[i]); } } } https://code.sololearn.com/cLqPB3w1NwBA/?ref=app
3 Answers
0
There is no error. Just take input like this
0
1
2
3
4
5
6
7
8
9
Sololearn doesn't support multiple input inside loop if it is not of fixed size. Your loop should be of fixed size.
https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
0
No there is something missing in this code
0
code is complete
use beautifier
https://www.tutorialspoint.com/online_java_formatter.htm



