Process Control
1. Sequential structure
Sequential structure means that the program executes the program in the order in which it is written.
2. Select structure
2.1 But branch structure statements
if (expression) {statement}
2.2 Dual-branch structure
if (expression) {}else if{} else{}
2.3 Multi-branch Structure statement
Switch ()
{
CASE constant: statement break;
Case .... break;
Default: Statement break ;
}
2.4-bar operators and conditional expressions
max= (a>b)? A:B;
A is greater than B if the condition is set then take a value, if the condition is not set to go to B
3. Cyclic structure
For, Goto, while, do-while
3.1 For statement
For (search variable assignment; loop condition; loop variable add value) {}
3.2 While statement
while (expression) {statement}
3.3do-while
Is the constant execution of a statement while (condition is set) jumps out
Do
Statement
while (condition)
3.4 Goto
Perform any structure
3.5 break
The concluding sentence jumps out of the loop;
3.6 Continue
Executes the next statement
3.7 Dead Loop and exit program
Exit (1); Exit function
C-Language Foundation-fifth chapter