Precedence
Operators *, /, and % have higher precedence than +, -.
Thus
5 + 3 * 4 is
5 + (3 * 4) = 5 + 12 =17
8 % 3 + 5 is
(8 % 3) + 5 = 2 + 5 = 7
Previous slide
Next slide
Back to first slide
View graphic version