0% found this document useful (0 votes)
31 views1 page

Precedence of C Operators

Operator precedence in C determines the order that terms in an expression are evaluated. Multiplication and division have higher precedence than addition and subtraction, so they are performed first. Operators with the highest precedence are evaluated first, from left to right. Parentheses can be used to override the normal precedence order.

Uploaded by

Rahul Gupta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

Precedence of C Operators

Operator precedence in C determines the order that terms in an expression are evaluated. Multiplication and division have higher precedence than addition and subtraction, so they are performed first. Operators with the highest precedence are evaluated first, from left to right. Parentheses can be used to override the normal precedence order.

Uploaded by

Rahul Gupta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Precedence of C Operators:

Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator: For example x = 7 + 3 * 2; Here x is assigned 13, not 20 because operator * has higher precedenace than + so it first get multiplied with 3*2 and then adds into 7. Here operators with the highest precedence appear at the top of the table, those with the lowest appear at the bottom. Within an expression, higher precedenace operators will be evaluated first. Category Postfix Unary Multiplicative Additive Shift Relational Equality Bitwise AND Bitwise XOR Bitwise OR Logical AND Logical OR Conditional Assignment Comma () [] -> . ++ - + - ! ~ ++ - - (type) * & sizeof */% +<< >> < <= > >= == != & ^ | && || ?: = += -= *= /= %= >>= <<= &= ^= |= , Operator Associativity Left to right Right to left Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Right to left Right to left Left to right

You might also like