Order of operations
In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that define which procedures to perform first in order to evaluate a given mathematical expression.
For example, in mathematics and most computer languages, multiplication precedes addition. Thus, in the expression 2 + 3 × 4, the answer is 14 (not 20). Brackets, ( and ), { and }, or [ and ] — which have their own rules — can indicate an alternate order or reinforce the default order to avoid confusion, thus the preceding expression could be changed to (2 + 3) × 4 to produce 20, or 2 + (3 × 4) to produce 14 (the default if there are no brackets).