The continue statement is a jumping statement which is used
to jump to the beginning of the loop i.e. when continue is encountered inside any loop, execution
(control) automatically jump or pass to the beginning of the loop and remaining
loop statements are skipped that come after the continue statement.
The loop does not terminate when a continue statement is encountered in the loop. The continue statement is usually
associated with an if() statement.
Ex:
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
for( x = 1; x<=10; x++)
{
if( x==5)
continue;
printf(“ %d \t”,x);
getch();
}
Output:
1 2 3 4 6 7 8 9 10
No comments:
Post a Comment