650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/202G93b2-0.gif "/> the control structure can be divided into three types:Sequence, branch, and loop
1. Order: statements are executed in sequence.
2. Branch: select to execute different statement blocks according to the conditions.
If else if: mainly for range matching
If (conditional expression)
{
// Statement block executed when the condition is expressed as true.
}
Else
{
// Statement block executed when the condition expression is false.
}
Switch case: Mainly used for single-value matching.
Switch (integer, enumeration, or string variable)
Case constant or literal
Each case should end with break.
Try catch
3. Loop: You can execute some statement blocks repeatedly.
For
While
Do while
Foreach: Read-Only
For:
For (initialization of cyclic variables; conditions for cyclic execution; process of changing cyclic variables)
{
Loop body
}
For: This is a cycle in which the number of cycles is determined by the major.
While do while: a loop with an uncertain number of cycles.
Endless loop: for (; true;) while (true)
For (int I = 1; I> 0; I ++)
The following items must be included in the Loop: Initialize the loop variable.
Cyclic execution Conditions
The process of changing cyclic Variables
Loop body
After learning the three control structures, we must make good use of them in subsequent studies to make them practical. 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/202G93W7-1.gif "/>
This article from the "Lanting drunk beauty" blog, please be sure to keep this source http://7607889.blog.51cto.com/7597889/1263014