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