[Study Notes] [C Language] assignment, learning notes assignment
The process of assigning a value to a variable is called a value assignment. 1. Simple assignment
The C language specifies that variables must be defined before they can be used. You can also define and assign values in the same statement.
Int a = 10 + 5; Operation Process
A = B = 10; calculation process
The left side of the equal sign cannot be a constant, for example, 10 = 11;
2. compound assignment
Complex addition, subtraction, multiplication, and Division remainder: a + = 4 + 5;
1 # include <stdio. h> 2 3 int main () 4 {5 int a = 10; 6 7 // a = a + 5; 8 9 // composite assignment operator 10 a + = 5; // a = a + 5; 11 12 a * = 5; // a = a * 5; 13 14 a + = 5 + 6 + 4; // a = a + (5 + 6 + 4); 15 16/* 17 1.18 */19 a = 5 + 6*5 + 8; 20 21 printf ("the value of a is % d \ n", a); 22 23 24 return 0; 25}