Question PSC-ARR-0030
EasyWhat will be printed by the following pseudocode?
Integer a[] = {3, 8, 5, 6}
Integer first = a[0], second = -1
for (each i from 1 to 3)
if (a[i] > first)
second = first
first = a[i]
else if (a[i] > second)
second = a[i]
end if
end for
Print second
- A.
6
- B.
5
- C.
3
- D.
8
Sign up free to see the answer and a step-by-step explanation.