Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. Input/Output statements
  5. Jump statements
  6. continue statement

continue statement

  • 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

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments