"Good Programmer's note sharing" C language while statement

Source: Internet
Author: User

iOS training------My C language notes, look forward to communicating with you!

#include <stdio.h>/*While (condition) {loop Body} operating principle 1. If the initial condition is not established, the loop body will never be executed 2. If the condition is established, the loop body is executed once, the execution is complete, and the condition is determined again ... break directly ends the entire while loop Continu E ends the current loop body and enters the next loop body execution*/intMain () {//1. First identify the actions that need to be performed repeatedly//2. Re-determination of constraints//defines the number of times a variable record is made    intCount =0; /*while (count<10) {++count;        if (count%2! = 0) {printf ("Do%d push-ups \ n", count); }    }*/    //Output Display:Do the 1th push-ups do 3rd push-ups do 5th push-ups do 7th push-ups do 9th push-ups/*while (count<10) {++count;        if (count%2 = = 0) {//directly end this cycle body, enter the next cycle continue;    } printf ("Do%d push-ups \ n", count); }*/    //Output Display:Do the 1th push-ups do 3rd push-ups do 5th push-ups do 7th push-ups do 9th push-ups while(Count <Ten)    {        ++count; printf ("do the first%d push-ups \ n", Count); if(Count = =5)        {             Break; }    }    //Output Display:Do the 1th push-ups do 2nd push-ups do 3rd push-ups do 4th push-ups do 5th push-upsreturn 0;}

"Good Programmer's note sharing" C language while statement

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.