Javatpoint Logo

91-9990449935

 0120-4256464

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

1
2
3
4
6
7
8
9
10

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 1
1 2
1 3
2 1
2 3
3 1
3 2
3 3

As you can see, 2 2 is not printed on the console because inner loop is continued at i==2 and j==2.

Next TopicC goto statement