In this section, I will share with you the following content:IOS developmentThe while statement used in the basic C language mainly introduces the differences between while LOOP, do... while loop and for loop and the use cases.
Loop Structure:
1. The loop structure is the program structure that gives full play to computer expertise in programming.
2. When a given condition is set, execute a program segment repeatedly until the condition is invalid.
3. The given condition is called a cyclic condition, and the program segment that is executed repeatedly is called a cyclic body.
While statement:
1. Calculate the sum of 1 + 2 + 3... + 100
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0939414349-0.png "alt =" 20130821114303_837.png "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0939412K6-1.png "alt =" 20130821114310_796.png "/>
When I is less than or equal to 100, sum is accumulated, and the result is the sum of 1 +... 100.
2. The sum of all numbers within 100 that are multiples of 13
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0939416062-2.png "alt =" 20130821114319_742.png "/>
When I is less than or equal to 100, the result is also accumulated by the number of three divisible values.
Do... while statement to express the relationship or logical expression ):
For statement:
A for Loop is the most commonly used loop in all cycles and the most flexible loop.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/093941I28-3.png "alt =" 201308211141__819.png "/>
When expression 1 and expression 2 are solved, if the value is true, execute the loop body statement, and then execute the statement to calculate the value of expression 3. This ends a loop and returns the calculation, start a new loop. If the condition is false, end the loop and run the statement after.
The aboveIOS TrainingIn C, the while LOOP, do... while loop, and for loop are used in different environments.IOS development, Mobile phone activation and sending can help everyone! If you are interested, you can follow me at any time and will share your experience with you.