Table of Contents
show
- A continue statement terminates the current iteration of the loop
- When a continue statement present inside a nested loop is executed, it only terminates the current iteration of the nearest enclosing loop
- On the execution of continue statement, the program control is immediately transferred to the header of the loop
Syntax
continue;
Example
#include<stdio.h>
int main()
{
int i;
for(i=1;i<=10;i++)
{
if(i%2 == 0)
continue;
printf("%d\t",i);
}
}
Output
1 3 5 7 9
Views: 0