Your expression is grouped as

(++x >= (y * 2)) || ((y % 2) && (z++ % 2))

and this is assigned to sum. This is specified by the grammar of C.

Note also that the right hand side of || is not evaluated if the left hand side is 1: which will mean that z is not incremented in that case.

  1. For avoidance of doubt, ++x is the new value of x, and z++ is the old value of z.

  2. Note also that because || is a sequencing point, the expression would be well defined even had you written x++ on the right hand side, rather than z++.

  3. Calling the result of this sum is an exercise in obfuscation.

Answer from Bathsheba on Stack Overflow
🌐
Cppreference
en.cppreference.com › w › c › language › operator_precedence.html
C Operator Precedence - cppreference.com
Operators are listed top to bottom, in descending precedence. ↑ The operand of prefix ++ and -- can't be a type cast. This rule grammatically forbids some expressions that would be semantically invalid anyway. Some compilers ignore this rule and detect the invalidity semantically.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › operator-precedence-and-associativity-in-c
Operator Precedence and Associativity in C - GeeksforGeeks
In C, expressions often contain ... precedence and associativity are rules that decide which operator is applied first and in which direction operators of the same precedence are evaluated....
Published   November 1, 2025
🌐
TutorialsPoint
tutorialspoint.com › home › cprogramming › c operators precedence
Operator Precedence in C
June 10, 2012 - The C compiler evaluates its value based on the operator precedence and associativity of operators. The precedence of operators determines the order in which they are evaluated in an expression. Operators with higher precedence are evaluated first.
🌐
Cppreference
en.cppreference.com › w › cpp › language › operator_precedence.html
C++ Operator Precedence - cppreference.com
When parsing an expression, an operator which is listed on some row of the table above with a precedence will be bound tighter (as if by parentheses) to its arguments than any operator that is listed on a row further below it with a lower precedence. For example, the expressions std::cout << a & b and *p++ are parsed as (std::cout << a) & b and *(p++), and not as std::cout << (a & b) or (*p)++. Operators that have the same precedence are bound to their arguments in the direction of their associativity.
🌐
Programiz
programiz.com › c-programming › precedence-associativity-operators
C Precedence And Associativity Of Operators: Definition and Examples
Become a certified C programmer. Try Programiz PRO! ... The precedence of operators determines which operator is executed first if there is more than one operator in an expression.
🌐
W3Schools
w3schools.com › c › c_operators_precedence.php
C Operator Precedence
Tip: Always use parentheses ( ) if you want to make sure the calculation is done in the order you expect. It also makes your code easier to read. Here are some common operators in C, from highest to lowest priority:
🌐
Microsoft Learn
learn.microsoft.com › en-us › cpp › c-language › precedence-and-order-of-evaluation
Precedence and order of evaluation | Microsoft Learn
The precedence and associativity of C operators affect the grouping and evaluation of operands in expressions. An operator's precedence is meaningful only if other operators with higher or lower precedence are present. Expressions with ...
Find elsewhere
🌐
IBM
ibm.com › docs › en › wdfrhcw › 1.4.0
C operators and operands
We cannot provide a description for this page right now
🌐
BYJUS
byjus.com › gate › operator-precedence-and-associativity-in-c
Use of the Operator Precedence and Associativity in C
February 16, 2024 - Operator precedence helps us determine which of the operators in an expression must be evaluated first in case the expression consists of more than a single operator. ... 50 – 2 * 15 is going to yield 20.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › c programming tutorial › operators precedence in c
Operators Precedence in C | Top 3 Examples of Operators Precedence
April 6, 2023 - Operator precedence in C tells you which operator is performed first, next, and so on in an expression with more than one operator with different precedence. This plays a crucial role while we are performing day to day arithmetic operations.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
WsCube Tech
wscubetech.com › resources › c-programming › precedence-associativity-operators
Operator Precedence and Associativity in C (With Examples)
August 29, 2025 - Learn about Operator Precedence and Associativity in C with examples. Understand how operators are evaluated to write efficient and error-free code.
🌐
PVS-Studio
pvs-studio.com › en › blog › terms › 0064
Operator precedence in C and C++
Operations are executed in a strict order. The value that determines a privilege to execute a certain operation is called precedence. The operation execution order can be regulated by use of parentheses.
Top answer
1 of 3
8


Explanation

Prec. denotes operator precedence, where group 1 has the highest precedence and group 17 the lowest.

Assoc. denotes operator associativity, where such is applicable. Associativity can be either left-to-right or right-to-left.

Sources

My ambition with this post is to provide a operator precedence table on-site at Stack Overflow, which is correct and canonical. This operator precedence table corresponds directly to chapter 6.5 of ISO 9899:2011, where we can read (6.5/3):

The grouping of operators and operands is indicated by the syntax. 85)

And then as a comment, in the informative (not normative) foot note:

85) The syntax specifies the precedence of operators in the evaluation of an expression, which is the same as the order of the major subclauses of this subclause, highest precedence first. /--/

Within each major subclause, the operators have the same precedence. Left- or right-associativity is indicated in each subclause by the syntax for the expressions discussed therein.

All formal operator names from the table are taken from chapter 6.5, where such a name could be found in normative text. Informal names were included in the cases where the programmer community might be more familiar with another name than the one given in the standard.

2 of 3
1

Here:

http://basen.oru.se/c/operators.html

(I added _Alignof, which I think is the only new operator in C11, to my own table, and published it there. Maybe that's cheating? Comments and suggestions on how to improve the table are welcome.)

🌐
University of Illinois Chicago
cs.uic.edu › ~i109 › Notes › COperatorPrecedenceTable.pdf pdf
C Operator Precedence Table
Search the site · Toggle Menu · Search · Computer Science · College of Engineering · Senior Design Expo · Join a CS Student Organization · CS student opportunities · Copy link · Learn about hackathons and more
🌐
Scaler
scaler.com › topics › c › operator-precedence-and-associativity-in-c
Operator Precedence and Associativity in C - Scaler Topics
January 31, 2022 - Operator precedence in C refers to the rules that determine the order in which operators are evaluated within an expression. This order of evaluation is crucial because it can significantly impact the outcome of an expression.
🌐
Swansontec
swansontec.com › sopc.html
C Language Operator Precedence Chart
Operator precedence describes the order in which C reads expressions. For example, the expression a=4+b*2 contains two operations, an addition and a multiplication. Does the C compiler evaluate 4+b first, then multiply the result by 2, or does it evaluate b*2 first, then add 4 to the result?
🌐
Wikipedia
en.wikipedia.org › wiki › Operators_in_C_and_C++
Operators in C and C++ - Wikipedia
3 weeks ago - The following table describes the precedence and associativity of the C and C++ operators. Operators are shown in groups of equal precedence with groups ordered in descending precedence from top to bottom (lower order is higher precedence).
🌐
Studytonight
studytonight.com › c › c-operators-precedence.php
C Operators Precedence | Studytonight
Based on the Precendence of operators, the C compiler decides the order in which the operators are evaluated. For example, if we have three variables a, b and c, then for the expression a+b*c, the compiler will first multiply b and c, and then add the result of the multiplication with a, because ...