Choose the correct pseudocode for the below problem statement.
Answer options
Correct answer: BEGIN, DECLARE variable arr[3][3], FOR i IN 0 to 2 DO, FOR j IN 0 to 2 DO, READ arr[i][j], END FOR, END FOR, FOR i IN 0 TO 2 DO, SET max = arr[i][0], FOR j IN 0 TO 2 DO, IF arr[i][j]>max THEN, max = arr[i][j], END IF, END FOR, PRINT "Max value in row "+(i+1)+" is "+max, END FOR, END
Explanation
Block C (indices 49-65) is correct. It reads all values first (nested FOR), then for each row (outer FOR i) sets max=arr[i][0], traverses columns (inner FOR j) to find the maximum, then PRINTS the row maximum INSIDE the outer loop (after inner FOR ends, before END FOR i). Block B prints after both loops (only one output); Block A sets max outside the row loop; Block D has READ misplaced outside the inner loop.