Back to GeekDojo

Practice with Bitwise Operations


Given two numbers, complete the following bitwise operation:

Please provide answer.

Tips

Convert each number to binary number, apply a bitwise operation, and then convert the binary result back to a decimal number.

Bitwise Operators
Operator Explanation
& (bitwise AND) 1 if both are 1. Otherwise, 0.
| (bitwise OR) 1 if any of them is 1. Otherwise, 0.
^ (bitwise XOR) 1 if both are different.
<< (Bitwise shift left) Shift bits to left side. Multiply by 2 on each shift.
>> (Bitwise shift right) Shift bits to right side. Divide by 2 on each shift.
Decimal <-> Binary
Decimal Binary Decimal Binary