Question PSC-ARR-0075
HardWhat will be the output of the following pseudocode?
Integer a[5] = {1, 2, 3, 4, 5}
Integer pre[6], i
pre[0] = 0
for (each i from 1 to 5)
pre[i] = pre[i - 1] + a[i - 1]
end for
Print pre[5] - pre[2], pre[4] - pre[1]
- A.
9 12
- B.
12 10
- C.
Sign up free to see the answer and a step-by-step explanation.