Operator Precedence
* / % then + - + then =
14 + 8 / 2 is therefore 18 (not 11)
Use parentheses to make things clear:
(14 + 8) / 2 = 11
Must be an equal number of left and right parens
Previous slide
Next slide
Back to first slide
View graphic version