Jan 16

Continue statement used inside the loop help to bypass the section of loop  and passes the control to the beginning of the loop to continue the execution with the next loop iteration.

Syntax

continue;

Example:

#include<stdio.h>

void main()

{

int i;

for (i=1;i<=20;i++)

{

if((i%5)==0)

continue;

printf(”%d “,i);

}

}

Output:

1  2  3  4  6  7  8  9   11  12  13  14  16  17 18 19

Here,the printf statement is bypassed each time when the value stored in i is divisible by 5.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • MySpace
  • Reddit
  • RSS
  • Twitter

written by Shweta