C-Flow control (sequential structure, selection structure, loop structure)

Source: Internet
Author: User

I. CHOICE of structure

1.if

Feature: At the same time, only one curly brace code will be executed

2,switch

Characteristics

    • By default, only one of the code following the case is executed
    • If there is no break behind a case, and if the case is true, it will be executed sequentially in all subsequent case statements, knowing that a break is encountered
    • If you want to define a new variable after the case, you must enclose it in curly braces {}

Second, the cycle structure

1,while

2,do while

Features: At least one cycle body is executed regardless of the condition

3,for

Select:::: General priority use for loop

Then consider the while

Finally, consider doing while

For loop structure:

The simplest form is: for (;;); For the Dead loop

Break

C-Flow control (sequential structure, selection structure, loop structure)

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.