C continue statement
The continue statement in C language is used to continue the execution of loop (while, do while and for). It is used with if condition within the loop.
In case of inner loops, it continues the control of inner loop only.
Syntax:
The jump statement can be while, do while and for loop.
Example of continue statement in c
Output
1243 697 810
As you can see, 5 is not printed on the console because loop is continued at i==5.
C continue statement with inner loop
In such case, C continue statement continues only inner loop, but not outer loop.
Output
1 11 22 11 3 2 33 33 13 2
As you can see, 2 2 is not printed on the console because inner loop is continued at i==2 and j==2.
No comments:
Post a Comment