Notification texts go here Contact Us Buy Now!

Deciphering C Programming Operator Precedence and Associativity: A Comprehensive Guide with Table

Description Operator Associativity
Function expression

( )

Left to Right
Array Expression

[]

Left to Right
Structure operators

->

Left to Right
Unary minus

Right to Left
Increment & Decrement

—  ++

Right to Left
One’s compliment

~

Right to Left
Pointer Operators

& *

Right to Left
Type cast

(data type)

Right to Left
size of operator

sizeof

Right to Left
Left and Right Shift

>>  <<

Arithmetic Operators

Multiplication operator, Divide by, Modulus

*,  /,  %

Left to Right
Add, Substract

+,  –

Left to Right

Relational Operators

Less Than

<

Left to Right
Greater than

>

Left to Right
Less than equal to

<=

Left to Right
Greater than equal to

>=

Left to Right
Equal to

==

Left to Right
Not equal

!=

Left to Right

Logical Operators

AND

&&

Left to Right
OR

||

Left to Right
NOT

!

Right to Left

Bitwise Operators

AND

&

Left to Right
Exclusive OR

^

Left to Right
Inclusive OR

|

Left to Right

Assignment Operators

=

Right to Left

*=

Right to Left

/=

Right to Left

%=

Right to Left

+=

Right to Left

-=

Right to Left

&=

Right to Left

^=

Right to Left

|=

Right to Left

<<=

Right to Left

>>=

Right to Left

Other Operators

Comma

,

Right to Left
Conditional Operator

?:

Right to Left

About the Author

Coding | Riding | Music, Embracing the beauty of code, the thrill of the ride, and the rhythm of life. Let's explore the journey together!

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.
Code Copied!