2 + 2 × 2 = ?
How good are you at Math? If you are good at it, you are sure to remember the order of mathematical operations (or operator precedence). The term is used not only by mathematicians but by computer programmers as well.
According to the rule, arithmetic operations are done from left to right, if a formula contains only addition and subtraction. In case there are not only addition and subtraction, but also division or multiplication, the latter two operations have priority, i.e. first you are to multiply or divide, and after that add or subtract.
So, the solution of our formula is as follows:
2 + 2 × 2 = 2 + (2 × 2) = 2 + 4 = 6
Order of operations