Google News
logo
Precedence & Associativity In C Language
Precedence : Precedence is nothing but priority that indicates which operator has to be evaluated first when there is more than one operator. 

Associativity :  when there is more than one operator with same precedence [priority] then we consider associativity, which indicated the order in which the expression has to be evaluated. It may be either from Left to Right or Right to Left.  
  Example :
x = 7 + 3 * 2; 

here, x is assigned 13, not 20 because operator * has higher precedence than +, so it first gets multiplied with 3*2 and then adds into 7.

Free Time Learn

Here, operators with the highest precedence appear at the top of the table, those with the lowest appear at the bottom. Within an expression, higher precedence operators will be evaluated first.

Operators

Note : Unary, Conditional & Assignment operators are evaluated from Right to Left, Remaining operators are from Left to Right.