Rules of Operator Precedence
C++ applies the operators in arithmetic expressions in a precise order determined by the following rules of operator precedence, which are generally the same as those in algebra:
1. Operators in expressions contained within pairs of parentheses are evaluated first. Parentheses are at the highest level of precedence. In cases of nested, or embedded, parentheses, such as
( a * ( b + c ) )
the operators in the innermost pair of parentheses are applied first.
2. Multiplication, division and modulus operations are applied next. If an expression contains several multiplication, division and modulus operations, operators are applied from left to right. Multiplication, division and modulus are on the same level of precedence. ...