Association
Operators *, /, and % have the save precedence; operator + and - have the same precedence. They all associates from left to right.
Thus
5 - 3 + 4 is
(5 - 3) + 4 = 2 + 4 = 6
8 % 3 * 5 is
(8 % 3) * 5 = 2 * 5 = 10
Previous slide
Next slide
Back to first slide
View graphic version