C language 2

Source: Internet
Author: User

//
// <# Initialization #> variable Initialization
// <# Condition #> cyclic conditions
// <# Increment #> // variable Increment
// <# Statements #> indicates the content that is repeatedly executed each time.

// The Name Of The cyclic variable is dominated by I, j, and K.

// Difference between while and do while
// For A While loop, you must first judge the loop condition and then execute the loop body. For do while, whether or not the condition is true, first execute the loop body and then judge the condition.
// Difference between while and
// While loops are mostly used to indicate the number of loops, while for loops are mostly used to know the number of loops. For loops can be converted to while loops, but while loops cannot be converted to for loops.
// When to use the loop
// When we do the same thing twice or more times, we need to consider using a loop to take repeated operations as the loop body.

Break; // jump out of the current loop, jump out of the current loop, and execute the following statement

Continue; // end this loop, that is, the execution of this loop ends till now, and then execute I ++ to continue the next loop

// Random number, arc4random () random function;
// Calculate the random number in the range of [a, B], arc4random () % (B-A + 1) +;

Related Article

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.