| Operator | Name | Meaning | Example |
|---|---|---|---|
& | Bitwise AND | Result bit is 1 only if both bits are 1 | 5 & 3 = 1 |
| | Bitwise OR | Result bit is 1 if at least one bit is 1 | 5 | 3 = 7 |
^ | Bitwise XOR | Result bit is 1 if bits are different | 5 ^ 3 = 6 |
~ | Bitwise NOT (Complement) | Inverts all bits (0→1, 1→0) | ~5 = -6 (in two's complement) |
<< | Left Shift | Shifts bits to the left by specified positions (×2 for each shift) | 5 << 1 = 10 |
>> | Right Shift | Shifts bits to the right by specified positions (÷2 for each shift, for positive numbers) | 8 >> 1 = 4 |