Continue Statement in C

Advertisements

Prev Tutorial Next Tutorial

Continue Statement in C

C Continue statement are used to skips the rest of the current iteration in a loop and returns to the top of the loop. The continue statement works like a shortcut to the end of the loop body.

Use break statement

Syntax

jump-statements (loop or switch case);
continue; 

Example of continue

#include<stdio.h>
#include<conio.h>

void main()
{    
int i=1;  
clrscr();    
  
for(i=1; i<=10; i++) 
{    
if(i==3)  //if value of i is equal to 3, it will continue the loop 
{  
continue;  
}  
printf("%d \n",i);  
}//end of for loop  
  
getch();    
}

Output

1
2
4
5
6
7
8
9
10

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements