Computer >> Computer tutorials >  >> Programming >> C programming

What is Evaluation, Precedence and Association in C language?


Expressions are evaluated by the ‘C’ compiler based on precedence and associativity rules.

If an expression contains different priority operators, then the precedence rules are considered.

What is Evaluation, Precedence and Association in C language?

Here, 10*2 is evaluated first since ‘*’ has more priority than ‘- ‘and ‘=’

If an expression contains same priority, then associativity rules are considered i.e. left right (or right to left).

What is Evaluation, Precedence and Association in C language?

What is Evaluation, Precedence and Association in C language?

What is Evaluation, Precedence and Association in C language?