Continue Statement In C Language
The continue statement is used
inside loop. When a continue statement is encountered inside a loop,
control jumps to the beginning of the loop for next iteration, skipping the
execution of statements inside the body of loop for the current iteration.
Syntax:
continue;
Fig: Continue statement in c |
Program
#include<stdio.h>
#include<conio.h>
void
main()
{
for(int
j=0;j<=8;j++)
{
if(j==4)
{
continue;
}
printf(“%d”,j);
}
getch();
}
Output:
0 1 2 3 5 6 7 8
No comments:
Post a Comment