int[] array1 = {1, 3, 5, 7}

for(int i =0; i if(array1[i] > 5)
System.out.println(i +" " + array1[i]);


Which indices are in bounds for the array array1, given thedeclaration above?

0, 1, 2,3
1, 2, 3,4
1, 3, 5,7
0, 1, 3,5

Respuesta :

Answer:   0,1,2,3

Explanation:

The array contains 4 elements that is 1,3,5,7.So the size of the array is 4.The indexing in an array starts from 0 means the element at 0 index is the first element in the array So 1 is at the index 0 and the index will increase by 1 as we move right of the array.So 3 is at the index 1 ,5 is at the index 2 and 7 is at the index 3.So the indices are 0,1,2,3.

ACCESS MORE