Monday 18 June 2018

What is operator precedence in C/C++ ?


It defines the way to evaluate an expression with multiple operators:

1. Unary [“Postfix”] à  A++, A--
2. Unary [“Prefix”] à ++A, --A
3. Arithmetic: Scaling à *, /, %
4. Arithmetic: Addition à +, -
5. Comparison operator à <, <=, >, >=
            6. Equality Operator à ==, !=
            7. AND à &&
            8. OR à ||
            9. Compound assignment operator. à =,+ =,- = etc.

No comments:

Post a Comment