C Programming

continue statement in c Programming 

The continue statement is used inside loops. When a continue statement is encountered inside a loop, control jumps to the beginning of the loop for next iteration, skipping the execution of statements inside the body of loop for the current iteration.

  • The continue statement is used inside loops in C Language. When a continue statement is encountered inside the loop, control jumps to the beginning of the loop for next iteration, skipping the execution of statements inside the body of loop after continue statement.
  • It is used to bring the control to the next iteration of the loop.
  • The continue statement skips some code inside the loop and continues with the next iteration.
  • It is mainly used for a condition so that we can skip some lines of code for a particular condition.
  • It forces next iteration in loop i.e. as break terminates the loop but continue forces the next iteration of the loop.

Syntax :

Continue;

Flow Diagram of Continue Statement in c:

Examples of Continue Statement :

#include <stdio.h>
int main()
{
   for (int j=0; j<=8; j++)
   {
      if (j==4)
      {
	    /* The continue statement is encountered when
	     * the value of j is equal to 4.
	     */
	    continue;
       }

       /* This print statement would not execute for the
	* loop iteration where j ==4  because in that case
	* this statement would be skipped.
	*/
       printf("%d ", j);
   }
   return 0;
}

Premium E-Books & Study Materials.

Access university-specific notes and programming guides. Download instantly to start studying.

Share Article :

TopperWorld
Prime E-Books.

Access complete study guides for programming and core CS concepts.

Recent Articles :

What Jobs Will AI Replace: Which Careers Will Grow in the Next 5 Years?
Java Most Asked Interview Question and Answer
Top 10 AI companies in India
How Generative AI is Transforming Programming
Top GITHUB Interview Questions and Answers