The use of 24._continue

Source: Internet
Author: User

Continue

Used to skip the remainder of this loop and go to the next loop to determine if it needs to be executed

1.for (1; 2; 3)

{

A

B

Continue If the statement is executed, execution of the statement 3,c and D will be skipped, and C and D will not be executed.

C

D

}

2.while (expression)

{

A

B

     3; //3 must be put in front of continue, not after

Continue If the statement is executed, the expression is executed after the statement is executed, and C and D are skipped, and C and D are not executed.

C

D

}

1 /*2 April 2, 2015 11:49:593 Objective:4 test the use of continue5 6 */7 8# include <stdio.h>9 Ten intMainvoid) One { A     inti; -     Charch; -  thescanf"%d", &i);//input 123m -printf"i =%d\n", i); -  -      while((Ch=getchar ())! ='\ n')//read extra characters m +         Continue; -  +     intJ; A  atscanf"%d", &j);//input -printf"j =%d\n", j); -  -     return 0; -  - } in /* - running the results in VC6.0 is: to ----------------------------- + 123m - i = 123 the  - * j = $ -----------------------------Panax Notoginseng Summary: -  the */
View Code

The use of 24._continue

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.