Answer:
C. "Condition one" is printed once, and "Condition two" is printed twice.
Explanation:
Given
The above code segment
Required
The number of times [tex]each\ print\ statement[/tex] is executed
For "Condition one" to be printed, the following conditions must be true:
if (col > 0) ---- the column must be greater than 0 i.e. column 1 and 2
if (arr[row][col] >= arr[row][col - 1]) --- the current element must be greater than the element in the previous column
Through the iteration of the array, the condition is met just once. When
[tex]row = 1[/tex] and [tex]col = 2[/tex]
[tex]arr[1][2] > arr[1][2-1][/tex]
[tex]arr[1][2] > arr[1][1][/tex]
[tex]4 > 3[/tex]
For "Condition two" to be printed, the following condition must be true:
if (arr[row][col] % 2 == 0) ----array element must be even
Through the iteration of the array, the condition is met twice. When
[tex]row = 0[/tex] and [tex]col = 1[/tex]
[tex]row = 1[/tex] and [tex]col = 0[/tex]
[tex]arr[0][1] = 2[/tex]
[tex]arr[1][0] = 4[/tex]