Pass control to next iteration of for
or while
loop
continue
passes control to the next iteration
of a for
or while
loop.
It skips any remaining statements in the body of the loop for the
current iteration. The program continues execution from the next iteration.
continue
applies only to the body of the
loop where it is called. In nested loops, continue
skips
remaining statements only in the body of the loop in which it occurs.
The continue
statement skips
the rest of the instructions in a for
or while
loop
and begins the next iteration. To exit the loop completely, use a break
statement.
continue
is not defined outside
a for
or while
loop. To
exit a function, use return
.