previous | index | next

Operator Precedence

Q: What is the correct value of
     ((3 + 4) * 9 - 2 * 3)?

A: It is as though the expression were fully parenthesized as:

     (((3 + 4) * 9) - (2 * 3)) = 57

Q: Why this parenthesization, and not some other one, like:

     ((3 + 4) * (9 - (2 * 3))) = 21 ?

A: Because of the precedence rules of arithmetic:


previous | index | next