C Programming: Operator Precedence and Associatively

OperatorDescriptionAssociativelyRank
()
[]
Function Call
Array element reference
Left to Right1
+

++

!
~
*
&
sizeof
(type)
Unary Plus
Unary Minus
Increment
Decrement
Logical Negation
Ones Complement
Pointer Reference
Address
Size of Object
Type Cast
Right to Left2
*
/
%
Multiplication
Division
Modulus
Left to Right3
+
Addition
Subtraction
Left to Right4
<<
>>
Left Shift
Right Shift
Left to Right5
<
<=
>
>=
Less Than
Less Than or Equal to
Grater than
Greater than or equal to
Left to Right6
==
!=
Equality
Inequality
Left to Right7
&Bitwise ANDLeft to Right8
^Bitwise XORLeft to Right9
|Bitwise ORLeft to Right10
&&Logical ANDLeft to Right11
||Logical ORLeft to Right12
?:Conditional expressionRight to Left13
=
*=/=%=
+=-=&=
^=|=
<<=>>=
Assignment OperatorsRight to Left14
,Comma operatorLeft to Right15
SHARE C Programming: Operator Precedence and Associatively

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Share