C language priority order: 1. Various brackets; 2. All unary operators; 3. Multiplication operator *, division operator /, remainder operator %; 4. Addition operator , Subtraction operator -; 5. Shift operator <<, >>; 6. Greater than operator>, Greater than or equal to operator>=, Less than operator<, Less than or equal to operator< =; 7. Equal operator ==, not equal operator !=; 8. Bitwise AND operator &; 9. Bitwise XOR operator ^; 10. Bitwise OR operator |; 11. Logical AND operation Symbols && and so on.
The operating system for this tutorial: Windows 10 system, C 20 version, DELL G3 computer.
The operators in C language include unary operators, binary operators, and ternary operators. The priorities are as follows:
First priority: various brackets, such as (), [], etc., member operators. ;
2nd priority: all unary operators, such as, –, !, ~, etc.;
3rd priority: multiplication operator* , division operator/, remainder operator%;
4th priority: addition operator, subtraction operator-;
5th priority: shift operator<< ;,>>;
6th priority: greater than operator>, greater than or equal to operator>=, less than operator<, less than or equal to operator<=;
7th priority: equal operator==, not equal to operator!=;
8th priority: bitwise AND operator&;
9th priority: press Bitwise XOR operator^;
10th priority: Bitwise OR operator|;
11th priority: Logical AND operator&&;
12th Priority: logical OR operator||;
13th priority: ternary conditional operator?: ;
14th priority: various assignment operators, such as =, = , -=, *=, /=, etc.;
15th priority: comma operation, .
The above is the detailed content of What is the priority order in C language?. For more information, please follow other related articles on the PHP Chinese website!