Precedence of Operators in C-programming

0
10

When several operations are combined into one C expression the compiler has to rely on a strict set of precedence rules to decide which operation will take preference. The precedence of C operators is given below.

PrecedenceOperatorAssociativity
Highest( ) [ ] -> .left to right
! ~ ++ — +(unary) -(unary) (type) * & sizeof()right to left
* / % left to right
+ – left to right
<< >>left to right
< <= > >=left to right
== !=left to right
& left to right
^ left to right
| left to right
&& left to right
|| left to right
? :right to left
= += -= *= /= %= &= ^= |= <<= >>=right to left
Lowest,left to right

LEAVE A REPLY

Please enter your comment!
Please enter your name here