Question PSC-BIT-0068
HardWhat will be printed by the following pseudocode?
Integer n = 10, i, total = 0
for (each i from 0 to (1 << 3) - 1)
if ((i & 1) == 1 and (i & 4) == 0)
total = total + i
end if
end for
Print total
- A.
6
- B.
16
- C.
4
- D.
10
Sign up free to see the answer and a step-by-step explanation.