
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

A quick reference for solving expressions correctly
() [] ->. postfix ++ postfix -- Left to right postfix / access
prefix ++ -- + -! ~ * & sizeof (type) Right to left unary / cast
<< >> Left to right bit shifts
< <= > >= Left to right relational comparison
== != Left to right equality comparison
& ^ | Left to right bitwise operations
&& || Left to right logical AND, logical OR
?: Right to left conditional expression
= += -= *= /= %= &= ^= |= <<= >>= Right to left assignment
, Left to right comma operator
result = 2 + (3 * 4) = 14; Multiplication has higher precedence than addition.
result = 5 * 4 = 20; Parentheses change the grouping.
Only c is divided by 3.0. Write (a + b + c) / 3.0 for the intended average.
UIET, CSJM University, Kanpur C Programming - Operator Precedence | Page 1 of 1