Question PSC-ARR-0005
EasyWhat will be the output of the following pseudocode?
Integer a[4]
for (each i from 0 to 3)
a[i] = i * i
end for
Print a[3]
- A.
4
- B.
9
- C.
Show answer and explanation
Answer: B
The loop stores i × i, so a = {0, 1, 4, 9} and a[3] = 9.