Lou iOS development tutorial C Language -- while statement

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.