195k views
3 votes
Using the bitwise AND operation, the result of 1 AND 0 is ___________. 10100100 ___________ 11010101 = 01110001. A common way to detect whether a value is even or odd is to use the ___________ operation to test if the least significant bit is set. Combining multiple flags into a single variable can be accomplished via the ___________ operation.

1 Answer

5 votes

Using the bitwise AND operation, the result of 1 AND 0 is 0.

10100100 XOR 11010101 = 01110001.

A common way to detect whether a value is even or odd is to use the AND 1 operation to test if the least significant bit is set.

Combining multiple flags into a single variable can be accomplished via the OR operation.

User Ben Tidman
by
7.8k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.