C Continue Statement


Next >>

continue Statement

  • continue statement in C programming is used to skip the current iteration and continue with the next iteration.
  • continue statement operates on loops only
  • it does not operate on switch.



Significance in Loops

  • In while and do..while loop, continue causes the program control to jump to the conditional expression, which is reevaluated for the next iteration.
  • In case of for loop, it causes the loop to first execute the increment and then cause the program control to transfer to the conditional expression which is reevaluated for next iteration.

Example C Program


int main()
  int a;
  for(a = 0 ; a<5 ; a++)
    if(a == 3)
    printf("The value of a = %d\n",a);

  printf("The final value of a = %d\n",a);




When you compile and execute the above program, you will get the following output:

<< Previous

Next >>