Continue Statement in C Programming

Sometimes, it is required to skip a part of a body of loop under specific conditions. So, C supports ‘continue’ statement to overcome this anomaly.

The working structure of ‘continue’ is similar as that of that break statement but difference is that it cannot terminate the loop. It causes the loop to be continued with next iteration after skipping statements in between. Continue statement simply skips statements and continues next iteration.

Syntax :

	continue;

Figure :

Program :

/*  Program to demonstrate continue statement.
Creation Date : 09 Nov 2010 07:44:43 PM
Author : www.technoexam.com [Technowell, Sangli] */

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

int main(void)
{
	int i;
	clrscr();
	for(i=1; i<=10; i++)
	{
		if(i==6)
		continue;
		printf("\n\t %d",i);  // 6 is omitted
	}
	getch();
	return 0;
}

Output :

	1
	2
	3
	4
	5
	7
	8
	9
	10_

Leave A Comment

Your email address will not be published. Required fields are marked *