logo CodeStepByStep logo

bitmask3

Author: Julie Zelenski (on 2018/02/03)

Assume x and y are 32-bit signed ints and that right-shift performs an arithmetic (not logical) shift. For each listed expression, work out what result it produces.

1 << x
(order shuffled)
~x + 1
(order shuffled)
x >> 31
(order shuffled)
x &= (x - 1)
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.