Home >Backend Development >C#.Net Tutorial >What is the order of precedence of operators in C language?
C language operator precedence sequence: unary operators multiplication and division operators addition and subtraction operators displacement operators relational operators equality operators logical operators conditional operators assignment operators
C language operator precedence sequence
In C language, the precedence of operators determines their order in an expression The order of execution. The higher the operator precedence, the first it is executed.
The following is the order of precedence of C language operators from high to low:
1. Unary operator
2. Multiplication and division operators
3. Addition and subtraction Operator
4. Bit shift operator
< (less than)
##== (equal to)
!= (not equal to)&& (logical AND)
|| (logical OR)? :
= (assignment)
= (plus assignment)|= (logical OR assignment)&= (logical AND assignment)
Operators with the same priority are executed in order from left to right.
You can use parentheses to change the execution order of operators.The above is the detailed content of What is the order of precedence of operators in C language?. For more information, please follow other related articles on the PHP Chinese website!