Answer:
c. 16 17
Step-by-step explanation:
Given
The above code segment
Required
The output
In the code segment, we have the following iterations:
for (int j = 0; j < arr.length; j++) and for (int k = 0; k < arr[0].length; k++)
The above iterates through all the elements of the array.
The if condition is true, only on two occasions
(i) When i = 0; j = 2
(ii) When i = 3; j = 0
i.e.
arr[0][2] = 14
arr[3[0] = 14
So, the result of the print statement is: j + k + arr[j][k]
(i) When i = 0; j = 2
j + k + arr[j][k] = 0 + 2 + 14 = 16
(ii) When i = 3; j = 0
j + k + arr[j][k] = 3 + 0 + 14 = 17
Hence, (c) 16 17 is true