Guided Notes
Operators & Booleans
Arithmetic, assignment, comparison, and logical operators; integer division and remainder; booleans with stdbool.h; and precedence.
Arithmetic and assignment
Slide 1 / 5| Operator | Meaning | Example (int a = 17, b = 5) |
|---|---|---|
| + - * | Add, subtract, multiply | a * b → 85 |
| / | Divide (integer if both ints) | a / b → 3 |
| % | Remainder (ints only) | a % b → 2 |
| ++ -- | Increment / decrement | a++ → a becomes 18 |
| = += -= *= /= %= | Assign / update | a += 3 → 20 |
