Quiz Entry - updated: 2026.07.14
What are the four fundamental Boolean operations and their symbols?
AND (&), OR (|), NOT (~), and XOR (^) — each combines bits by a fixed rule, one bit position at a time.
| Operation | Symbol | C Operator | Result |
|---|---|---|---|
| AND | A&B | & |
1 only if both inputs are 1 |
| OR | A|B | | |
1 if either input is 1 |
| NOT | ~A | ~ |
Inverts each bit |
| XOR | A^B | ^ |
1 if inputs differ |
Truth table for XOR:
0^0 = 0 0^1 = 1
1^0 = 1 1^1 = 0
Tip: XOR is "exclusive or" - true when inputs are different.
Go deeper:
Bitwise operation (Wikipedia) — AND, OR, XOR, NOT and the shifts, with truth tables and uses.