Your response:
Correct answer:
Explanation:
Convert each number to binary number, apply a bitwise operation, and then convert the binary result back to a decimal number.
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 |
---|