In my opinion, getting the values from the array would be a very much good idea, like this,
int[] arr = { marks[1], marks1[1], marks2[1] };
Enough. It would have an array of 3 elements having the value of second element in those three arrays.
Otherwise, if you want to get the values using the loop. You would write the loop and get the value using the index variable. But,
remember, you only want
one value so
do not waste CPU cycles on extra loops. Write it this way,
int a = 0;
for (int i = 1; i < 2; i++ ) { a = marks[i]; }
The above loop would run only once, because in the first time the condition would be true, then it would be false so after getting the value at index 1 (element 2) it would break. Write it this way,
int[] arr = { 0, 0, 0 };
for (int i = 1; i < 2; i++) { arr[0] = marks[1]; }
for (int i = 1; i < 2; i++) { arr[1] = marks1[1]; }
for (int i = 1; i < 2; i++) { arr[2] = marks2[1]; }
{ 98, 19, 1 }
There you go.