logo CodeStepByStep logo

bitmask1

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

Assume mine is an unsigned int being used as bit vector. For each listed task, show how to express it in C.

test if mine has either of two lowest bits on
(order shuffled)
test if mine has both of two lowest bits on
(order shuffled)
set lowest 8 bits of mine
(order shuffled)
clear every other bit in mine
(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.