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