Operator PrecedenceThe operations within an expression are completed in a particular order depending on their precedence (priority). The table shows the default order of the operations from first to last (from top to bottom).
Table: Order of OperationsThe Operators with higher precedence are applied first. In the illustration below, both the expressions yield 8 as the division has a higher precedence than addition. The Operators with similar precedence are applied in no particular order.
5 + 12 / 412 / 4 + 5You can use the parentheses to control the order of the evaluation. For illustration, the expression below yields 7, not 11, as the parentheses override the default operator precedence:(8 + 6) / 2In the later example, the subtraction is completed before the division as the most deeply nested sub expression is always checked first:100 + (20 / 5 + (7 - 3))