Question PSC-ARR-0041
MediumWhat will be printed by the following pseudocode?
Integer a[6] = {4, 8, 15, 16, 23, 42}
Integer i, s = 0
for (each i from 0 to 5)
if (i mod 2 == 1)
s = s + a[i]
end if
end for
Print s
- A.
42
- B.
66
- C.
Sign up free to see the answer and a step-by-step explanation.