Question PSC-ARR-0078
HardWhat will be the output of the following pseudocode?
Integer a[6] = {9, 4, 7, 1, 8, 3}
Integer i, m1 = -1, m2 = -1
for (each i from 0 to 5)
if (a[i] > m1)
m2 = m1; m1 = a[i]
else if (a[i] > m2)
m2 = a[i]
end if
end for
Print m1 * m2
- A.
81
- B.
72
- C.
Sign up free to see the answer and a step-by-step explanation.