What is Continue Statement in C programming language ?

Continue Statement in C

 In this article we will cover following topic which are mention below ;

  • Continue statement in C
  • Example of Continue statement in C

Continue Statement in C :

The continue statement is used while we need to visit the next iteration of the loop after skipping a few statements of the loop.

This statement simply written as:- continue;

It is normally used with a condition. When continue statement is encountered all of the remaining statement(statement after continue) in the current iteration are not executed and the loop continue with next iteration.

Example of Continue Statement in C :

//Program to understand the use of continue statement


#include<stdio.h>
int main ( )
{
int n;
for(n=1;n<=5;n++)
{
if(n==3)
{
printf ("I understand the use of continue\n");
continue;
}
printf ("Number = %d\n", n) ;
}
printf ("Out of for loop\n");
return 0;
}

Post a Comment (0)
Previous Post Next Post