In the C language, expressions are evaluated according to certain rules of precedence. In other words, with no other guidance, a long expression containing several values and operators is evaluated according to a collection of rules that evaluates pairs of values according to something called associativity.
The standard rules follow the mathematical rules that evaluate expressions in the following sequence:
Anything in brackets
Less than, and less than or equal to
Greater than, and greater than or equal to
Equals and not equals
Assignment with operators (+=, -=, and so on)
There are more than the ones listed here, which is why I suggest one simple rule—Put everything in brackets ...