Precedence of Operators in C
Precedence of Operators in C
An operator is simply a symbol that is used to perform operations. There can be many types
of operations like arithmetic, logical, bitwise etc.
Arithmetic Operators
Relational Operators
Shift Operators
Logical Operators
Bitwise Operators
Ternary or Conditional Operators
Assignment Operator
Misc Operator
Precedence of Operators in C
The precedence of operator species that which operator will be evaluated first and next. The
associativity specifies the operators direction to be evaluated, it may be left to right or right
to left.
1. int value=10+20*10;
The value variable will contain 210 because * (multiplicative operator) is evaluated before
+ (additive operator).
Additive +- Left to
right
Equality == != Left to
right
Bitwise OR | Left to
right
Logical OR || Left to
right
Conditional ?: Right to
left