Guided Notes

Operators & Booleans

Arithmetic, assignment, comparison, and logical operators; the bool type and boolalpha; short-circuiting; and precedence.

Arithmetic and assignment

Slide 1 / 5
OperatorExample (a = 17, b = 5)Result
+ - *a * b85
/a / b (ints)3
%a % b2
++ --a++a becomes 18
+= -= *= /= %=a += 3a becomes 20
← Variables, Data Types & Constants