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