Question PSC-LOOP-0075
HardWhat will be the output of the following pseudocode?
Integer x = 0, i
for (each i from 1 to 10)
if (i mod 2 == 0)
x = x + i
else
x = x - i
end if
end for
Print x
- A.
55
- B.
5
- C.
Sign up free to see the answer and a step-by-step explanation.