Question PSC-BIT-0073
HardWhat will be the output of the following pseudocode?
Integer n = 13, ans = 0, bit = 1
while (n > 0)
if ((n & 1) == 0)
ans = ans | bit
end if
bit = bit << 1
n = n >> 1
end while
Print ans
- A.
15
- B.
2
- C.
Sign up free to see the answer and a step-by-step explanation.