Question PSC-ARR-0060
MediumWhat is the output of this pseudocode?
Integer a[6] = {1, 4, 2, 5, 3, 6}
Integer even = 0, odd = 0, i
for (each i from 0 to 5)
if (a[i] mod 2 == 0)
even = even + a[i]
else
odd = odd + a[i]
end if
end for
Print even - odd
- A.
3
- B.
21
- C.
Sign up free to see the answer and a step-by-step explanation.