Topics
GitHub Projects to Learn
Visualisation with AI
Portofolio Maker
Travel Planner
Logic Operation
1. Bitwise OR (`|`)
Rule: The resulting bit is `1` if at least one of the corresponding bits is `1`.
Examples:
- `0 | 0 = 0`
- `0 | 1 = 1`
- `1 | 0 = 1`
- `1 | 1 = 1`
2. Bitwise XOR (`^`)
Rule: The resulting bit is `1` if the corresponding bits are different, and `0` if they are the same.
Examples:
- `0 ^ 0 = 0`
- `0 ^ 1 = 1`
- `1 ^ 0 = 1`
- `1 ^ 1 = 0`
3. Bitwise AND (`&`)
Rule: The resulting bit is `1` only if both corresponding bits are `1`.
Examples:
- `0 & 0 = 0`
- `0 & 1 = 0`
- `1 & 0 = 0`
- `1 & 1 = 1`