It is a keyword which is used to skip the statements in a loop.
(or)
This statement is used to continue the execution of loop. It is used with if condition with in the loop.
Syntax:-
Conditional code
{
if(cond)
{
continue;
}
statement;
}
Flow chart:-
Programs:
* Write a program to use continue statement & skip the one number.
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=1;i<=10;i++)
{
if(i==3)
continue;
printf("%d\t",i);
}
getch();
}
|
Output:-
* Write a program to use continue statement & skip the two numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=1;i<=10;i++)
{
if(i==5||i==8)
continue;
printf("%d\t",i);
}
getch();
}
|
Output:-
__________________________________________________
___________________________________________________
_____________________________________________________
___________________________________________________
Post a Comment