Question PSC-ARR-0051
MediumWhat does the following pseudocode print?
Integer a[5] = {7, 3, 9, 1, 6}
Integer i, pos = 0
for (each i from 1 to 4)
if (a[i] < a[pos])
pos = i
end if
end for
Print pos, a[pos]
- A.
0 7
- B.
4 6
- C.
3 1
- D.
1 3
Sign up free to see the answer and a step-by-step explanation.