Introduction :
Continue statement in c++ can be considered to be a loop that controls the statement that is supposed to force the program control for executing the next iteration from the loop. Talking about the results, the code that is inside the loop that follows the continue statement is going to get skipped and the next iteration of the loop is going to begin.
Syntax:
continue;
Example : Considering any situation where we might need to write some program that is supposed to be printing numbers that will be from 1 to 10 but except 4. It can be specified that one will have to do this with the help of loop and in this case only one loop is allowed to be used. In such cases comes the usage of the continue statement. We are supposed to do here is that we will have to run a loop from 1 to 10 and everytime we will be having to compare the value of the iterator with the value 4. If in some case it becomes equal to 4 then we have to use continue statement right there for continuing to the next iteration and otherwise we are supposed to be printing the values simply.
Continue statements with for loops:-
While using continue statements with for loops we will have to put this statement inside the loops so that the control flow jumps to the next iteration without executing the current iteration completely.