The job of a computer is to perform a series of operations. The C language provides different operators for different operations!
1. Operators
. Basic Operators
Arithmetic Operator: +-*/% + + --
Value assignment operator: =
Comma OPERATOR :,
Relational operators: <><=>=! =
Logical OPERATOR: & |!
Conditional OPERATOR :? :
. Bit Operator
Bit logical operators :~ & | ^ (Exclusive or)
Offset OPERATOR: >><
2. Operation priority
When multiple operations are used together, we need to know the sequence of operations. Otherwise, different values may be obtained! When relational operations, value assignment operations, logical operations, and arithmetic operations are mixed, they are as follows:
! > Arithmetic operation> relational operation> & amp; and |> value assignment operation
Note: among all operators, the comma operator has the lowest priority. The assignment operator has a higher priority than the comma operator.
3. Expressions and their values
. Expressions are composed of operators and operands. The simplest expression is a separate operand. Based on this, you can create a complex expression.
Different expressions have different expression values, such:
Value assignment expression ---- the value is the same as the value obtained by the = variable.
Arithmetic expression ---- the value is the structure of arithmetic operation
Relational Expression ---- the value is 1 or 0
Logical expression ---- the value is also 1 or 0
Comma expression ---- the value of the last expression
4. Statements
A statement (statement) is a complete computer command. In C, the statement is identified by a semicolon at the end. A set of different statements forms a program.
The basic statements in C language can be divided into declaration statements, expression statements, function call statements, control statements, compound statements, and empty statements.