The ones who are crazy enough to think they can change the world are the ones who do.- Steve Jobs
The continue statement enables you to skip to the next iteration in the loop containing the continue statement. The labeled continue statement enables you to skip to the next iteration in an outer loop enclosing the labeled continue that is identified by the label. The labeled loop need not be the loop immediately enclosing the labeled continue.
The following flowchart will help you to understand how continue statement works
Let us write a C program to demonstrate continue statement
#include <stdio.h> //header file section int main() { int a; for(a = 1;a <= 5; a++) { if(a == 4) { continue; } printf("%d", a); } return 0; }
When the variable reaches the value 4, the loop skips the statements within a block, only for that particular iteration.
We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.
© Copyright 2019