continue statement

continue statement:

It’s forces the next iteration of the loop to take place, skipping remaining code in between.
Syntax
Continue;

1. In the case of the for loop just after the execution of continue statement, increment/decrement statement of the loop gets executed. After execution of increment statement, condition will be checked.
2. In case of the while loop statement, continue statement takes control to the condition statement.
3. In case of the do..while loop, continue statement takes control to condition statement specified in the while loop.

Flow chart:

continue

Example

#include<iostream.h>

#include<conio.h>

main()

{

for(int z=0; z<6; z++)

{

cout<<” The User is a very good skill programmer :”<<endl;

continue;

cout<<” The User is not good programmer :”<<endl;

}

getch();

}

Output

The User is a very good skill programmer :

The User is a very good skill programmer :

The User is a very good skill programmer :

The User is a very good skill programmer :

The User is a very good skill programmer :

The User is a very good skill programmer :

 

Leave a Reply

Your email address will not be published. Required fields are marked *