Question PSC-ARR-0062
HardWhat does the following pseudocode print?
Integer a[7] = {4, 3, 2, 7, 8, 2, 3}
Integer i, out = 0
for (each i from 0 to 6)
Integer idx = abs(a[i]) - 1
if (a[idx] < 0)
out = out * 10 + abs(a[i])
else
a[idx] = -a[idx]
end if
end for
Print out
- A.
23
- B.
48
- C.
Sign up free to see the answer and a step-by-step explanation.