I. Conditional statements are general-speaking selection structures
Select Structure-
if statement ;
- First structure: if (condition) {statement 1; Statement 2; ...}
- Second structure: if (condition) {statement 1; Statement 2; ...} else{statement 3; statement 4; ...}
- Third structure: if (condition) {statement 1; Statement 2; ...} else if (condition 2) {statement 3; statement 4; ...} else if (condition 3) {statement 4; statement 3; ...} else if (condition 4) {statement 4; statement 3; ...} else{statement 4; statement 3; ...}
- The fourth structure: if (conditional) statement 1; no curly braces; The preceding conditional statement is over; if there is a statement 2, it is not related to if;
- Note: If use NOTE: Any numeric value is true or false; int a = 10;if (A = 0) {} Where a =0 is an assignment operation, we cannot use it here, we are judging whether a is equal to 0, rather than assigning a value to A; To avoid this error can be written if (0 = = a) {} , you can avoid yourself less = number;
- judge whether the value is equal, write the constant value to the left;
- Note that the assignment operator has only one equal sign, not two equals sign; = = is a relational operator;
- Cannot write: if (10>6) int a = 5; without curly braces, the scope of int A is not known; the scope of the code is ambiguous;
- Because int A is behind if, it is limited to the IF statement, but the if scope is ambiguous;
- Writing format:
switch Statement ;
- structure: switch (value) {}
-
- break is the exit switch function; return exits the main function;
- break importance: If there is no break after the case, You will be executed in all of the following case, until you encounter a break; if the case is judged once, the subsequent conditions will not be judged if there is no break at the back;
-
- if in the implementation of the size of the comparison, switch can not do, switch inside the function can be achieved in the if can be achieved;
- 1), Bytes and addresses: 1GB how many bytes: Each byte has its own address;
2), the larger the data, The larger the bytes to take up,
3), the memory addressing from large to small,
4), the address of the variable is the smallest of the bytes, the more defined the variable, the greater the memory address, the   
5), & is the address operator; used to get the variable;
6), Assign the following address to the previous variable,%p is the address of the output variable,
7), the variable is not initialized, and it is incorrect to use;
scanf function:
1), and the printf function opposite; this is the input; let the user enter;
2), when using scanf, take the address &; space symbol is \
Conditional Statement C