Most expressions use operators, which combine one or more operands to form an expression and return the operation result. 1. expression expressions are composed of operators and operands. Below are several simple expressions: [csharp] <span style = "font-size: 18px; "> int I = 556 // declare an int type variable I and initialize it to 556 I = I * I-11 // change the value of variable I </span> 2. operator operators are special symbols used to process data operations. The following are common operators in C. 2.1 Arithmetic Operators +,-, *,/, and % are called Arithmetic Operators, respectively performing addition, subtraction, multiplication, division, and remainder operations. 2.1.1 The addition operator performs a standard addition operation by adding two numbers. Sample Code: [csharp] Staticvoid Main (string [] args) {Int M1 = 999; // declare the integer variable M1 and assign a value of 999 Int M2; // declare the integer variable M2 M2 = M1 + 1; // The M2 value is the value after the sum of M1 and 1. Console. writeLine (M2.ToString); Console. read (); 2.1.2 the subtraction operator performs standard Subtraction by subtracting the value of another expression from one expression. Sample Code: [csharp] M2 = M1-1; // The M2 value is the value after M1 and 1 subtraction 2.1.3 multiplication operator performs the multiplication (*) operation through two expressions, and return the product of them. Sample Code: [csharp] Sum = is1 * is2 // execute the Division operator (/) to make the sum value the product 2.1.4 of is1 and is2, it uses the divisor expression divided by the divisor expression to obtain the quotient. Sample Code: [csharp] Is = shi1/shi2 // set the value of is TO shi1 divided by shi2 and the obtained value 2.1.5 returns the remainder after the division and the Division. 2.2 The Value assignment operator assigns new values to variables, attributes, events, and other elements. There are several major assignment operators: name operator Rule Meaning assignment = assign the expression to the variable Add the value on the right to the left + = x + = y x = x + y minus the value-= x-= y x = x-y multiplication assignment * = x * = y x = x * y Division assignment/= x/= y x = x/y modulo assignment % = x % = y x = x % y is located in the Value & = x & = y x = x & y shifted right value> = x> = y x = x> y shifted left value <= x <〈〈 = y x = x <y XOR or assignment = x = y x = xy sample code: [csharp] view plaincopyStatic void Main (string [] args) {Int I = 999; // declare the integer variable I and assign the value 999 I + = 1; // use the plus value assignment operator Console. writeLine ("last I value: {0}", I); Console. readLine ();} The final running result of the program is: 1000 2.3 Relational operators, as the name implies, can be used to compare two values. After an operation, a Boolean value representing the operation result is returned. Common Relational operators: Relational operators are equal to or equal to the Relational operators = (different from vb! = Not equal to> greater than = greater than or equal to <less than <= less than or equal to Relational operators are generally used in judgment or loop statements. Sample Code: [csharp] view plaincopyInt m1 = 111; // declare the integer variable m1 Int m2 = 222; // declare the integer variable m2 bool result; // declare the bool variable result = m1 = m2; // make result equal to m1 and m2 and return the result console. writeLine (result); console. readLine (); the running result of the program is False 2.4 logical operators (this blog will introduce in detail). logical operators perform Boolean operations on the two expressions. C # Sino-German logical operators can be divided into bitwise logical operators and Boolean logical operators ". 2.4.1 bitwise logical operators include the bitwise "and" operator, the bitwise "or" operator, and the bitwise "XOR" operator. 2.4.1 Boolean logical operators include: Boolean "and" operator, Boolean "or" operator, and Boolean "XOR" operator. 2.5 The shift operator mainly includes the Left shift operator and the right shift operator. The Left shift operator (<<) can be used to shift the number to the left, which means that all bits are moved to the left for a specified number of times. The high sub-position will be lost, and the low position will be filled with zero. The right shift operator is similar to the Left shift operator. 2.6 other special operators include: is, conditional, new, and typeof. If you are interested, you can learn more. 3. Generally, an expression with an operator priority contains more than one operator. How can the program determine the sequence of operators? This utilizes the priority of operators. Operators with higher priority are executed first. It shows in detail the priority of operators: the priority order of classification operators is basically x. y, f (x), a [x], x ++, x-, new, typeof, checked, unchecked from high to low Monday + ,-,! ,~, ++, --, (T) x multiplication and division *,/, % addition and subtraction +,-shift <,> comparison <, ><=, <=, is, as equal = ,! = Bitwise AND & bitwise exclusive or bitwise | logical and & logical or | condition?: Assignment =, + =,-=,/=, * =, % =, and & = are some of my introduction to expressions and operators in C, hope to help you ~