C++ evaluates operators in a specific order called precedence. Multiplication and division happen before addition and subtraction. In 2 + 3 * 4, C++ computes 3 * 4 = 12 first, then 2 + 12 = 14.
Operators with the same precedence evaluate left to right. int y = 10 - 5 - 2; becomes (10 - 5) - 2 = 3, not 10 - (5 - 2) = 7. Assignment has the lowest precedence. int a = 5 + 3; adds first, then assigns 8 to a.
Precedence rules ensure expressions evaluate correctly.