The use of continue in C language, while learning to receive characters, print characters, traverse characters

Source: Internet
Author: User

1 /*************************************************************************2 > File name:continue.c3 > Author:Mr.Yang4 the application of > Purpose:continue5 > Created time:2017 May 19 Friday 13:37 36 seconds6  ************************************************************************/7 8#include <stdio.h>9#include <stdlib.h>Ten  One intMainvoid) A { -         Chars[ -]; -printf"\nenter a line of text:"); theFgets (s), -, stdin);//"reads a line or a specified number of characters from the file stream" -         inti =0; -          for(i =0; S[i]! =' /'; i++)//How to traverse a string -         { +                 if(S[i] = ='a'|| S[i] = ='e'|| S[i] = ='I'|| S[i] = ='o'|| S[i] = ='u') -                 { +                         Continue;//continue immediately executes the next loop, remembering that the continue can only be used within a for Do...while loop A                 } at  -Putchar (S[i]);//This function displays a character to the screen!  -         } -printf"\ n"); -         return 0; -}

Note: Continue is the current iteration of the end loop and goes directly to the next iteration--the loop is not over
And break is the direct end of the loop--the loop is over.

The use of continue in C language, while learning to receive characters, print characters, traverse characters

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.