0% found this document useful (0 votes)
65 views2 pages

C Precedence and Associativity of Operators - Definition and A PDF

The document summarizes C operators with their precedence and associativity. It lists the operators in order from highest to lowest precedence. It includes unary, binary, logical, bitwise, relational, assignment, and conditional operators. It provides the meaning and associativity of each operator type from left to right or right to left.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views2 pages

C Precedence and Associativity of Operators - Definition and A PDF

The document summarizes C operators with their precedence and associativity. It lists the operators in order from highest to lowest precedence. It includes unary, binary, logical, bitwise, relational, assignment, and conditional operators. It provides the meaning and associativity of each operator type from left to right or right to left.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Summary of C operators with precedence and associativity

Operator Meaning of operator Associativity

() Functional call Left to right


[] Array element reference
-> Indirect member selection
. Direct member selection

! Logical negation Right to left


~ Bitwise(1 's) complement
+ Unary plus
- Unary minus
++ Increment
-- Decrement
& Dereference Operator(Address)
* Pointer reference
sizeof Returns the size of an object
(type) Type cast(conversion)

* Multiply Left to right


/ Divide
% Remainder

+ Binary plus(Addition) Left to right


- Binary minus(subtraction)

<< Left shift Left to right


>> Right shift

< Less than Left to right


<= Less than or equal
> Greater than
>= Greater than or equal

== Equal to Left to right


!= Not equal to

& Bitwise AND Left to right

^ Bitwise exclusive OR Left to right

| Bitwise OR Left to right

&& Logical AND Left to right


Operator Meaning of operator Associativity

|| Logical OR Left to right

?: Conditional Operator Right to left

= Simple assignment Right to left


*= Assign product
/= Assign quotient
%= Assign remainder
-= Assign sum
&= Assign di erence
^= Assign bitwise AND
|= Assign bitwise XOR
<<= Assign bitwise OR
>>= Assign left shift
Assign right shift

, Separator of expressions Left to right

C Programming

C Introduction
C Flow Control
C Functions
C Programming Arrays
C Programming Pointers
C Programming Strings
Structure And Union
C Programming Files
Additional Topics

You might also like