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?

If you do not understand how to solve an exercise or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect tests, etc.), please

Is there a problem? Contact a site administrator.

©, all rights reserved.