logo CodeStepByStep logo

bitmask2

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

Give a C expression to construct each of the following masks for a 32-bit unsigned integer.

all bits on
(order shuffled)
one bit on in position n, all others off
(order shuffled)
n least significant bits on, all others off
(order shuffled)
most significant bit on, all others off
(order shuffled)
k most significant bits on, all others off
(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.