Home > Electronics Tutorials > C Language Tutorial > Operators - Precedence

C Language Programming Library Reference Guide

Operators - Precedence

The operators have a set order of precedence during evaluation. Items encapsulated in parenthesis are evaluated first and have the highest precedence. The following chart shows the order of precedence with the items at the top having highest precedence.

 

Operator Name
! Logical NOT. Bang.
++ -- Increment and decrement operators.
* / % Multiplicative operators.
+ - Additive operators.
<< >> Shift operators.
< > <= >= Inequality comparators.
== != Equality comparators
& Bitwise AND.
^ Bitwise XOR.
| Bitwise OR.
&& Logical AND.
|| Logical OR.
?: Conditional.
= op= Assignment.

Examples:

17 * 5 + !(1+1) && 0 Evaluates to 0 (false). 5+7<4 Evaluates to 1 (true). a<b<c Same as (a<b)<c.
Note: To report broken links or to submit your projects, tutorials please email to Webmaster

Discover

     more......