Question PSC-BIT-0017
HardWhat will be the output of the following pseudocode?
Integer n = 6, rev = 0
for (each i from 1 to 4)
rev = (rev << 1) | (n & 1)
n = n >> 1
end for
Print rev
- A.
12
- B.
3
- C.
Sign up free to see the answer and a step-by-step explanation.