public static void main (String[] args)
{
int[] arr = new int[2];
arr[0] = 10;
arr[1] = 20;
for (int i = 0; i <= arr.length; i++)
System.out.println(arr[i]);
}
Answers
Answered by
0
Answer:
10
20
Explanation:
array length is 2 and arr[0]=10 and arr[1]=20
and you are printing array arr.length times so it will print the result
Similar questions