GATEverse
← GATE CSE 1993

Q12

NATMarks unknown

The following Pascal program segments finds the largest number in a two-dimensional integer array A[0…n−1,0…n−1]A[0\dots n-1, 0\dots n-1] using a single loop. Fill up the boxes to complete the program and write against A,B,C and D\fbox{A}, \fbox{B}, \fbox{C} \text{ and } \fbox{D} in your answer book Assume that max is a variable to store the largest value and i,ji, j are the indices to the array. begin max:=|A|, i:=0, j:=0; while |B| do begin if A[i, j]>max then max:=A[i, j]; if |C| then j:=j+1; else begin j:=0; i:=|D| end end end

Sign in to save attempts.

Loading…