continue in C++ by R4R Team

Continue is the statement in C++:

What is Jump statement?
-Jump statements cause an unconditional jump to another statement elsewhere in the code. They are used primarily to interrupt switch statements and loops.

How many jump statement in C++ ?
-break
-continue
-goto

Continue statement:
It is jumping statement which continue the loop iteration from the point where it writtten.

program:

#include < iostream>
using namespace std;
int main()
{
int i=1;
while(i<=10)
{
if(i==1 || i==5 || i==7 || i==9)
{
i++;
continue;
}
cout<< i<<" ";
i++;

}
return 0;
}


output-

2 3 4 6 8 10

-In this program, we run loop from i=1 to i=10 but in between at i=1,5,7,9 , we continue loop so this value is not printed.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!