Register | Sing In

New posts

Stacks in C programming Linked Lists in C programming File Input/Output in C programming Check prime numbers in C Programming C Programming Enumeration C Programming Union

Archives

2013-10 2013-09 2013-08

Continue statement in C programming

August 25, 2013 Posted by: GPA Views: 633 0 comments

In some situations we do not need to execute some statements under the loop. For this purpose, C provides the operator continue . In the case of while loops and do-while the continue statement skips the operators of the loop is not executed at the current iteration, and the transfer of control to the code that checks the condition of the loop structure. Below is an example with using continue operator.

 

Example:

   

#include <stdio.h>
#include <stdlib.h>
//main function
int main(int argc, char *argv[]){
   int i;
   for(i=0;i<10;i++){
   if (i==3) continue;//Used continue to skip printing the value 3
       printf("%d ",i);
   }
   system("PAUSE");//delay
   return 0;
} 

Output

Continue statement in C example

Download this example

0 Comments...

Leave a Reply

Please, Sing In to leave a Reply for this material.



Online Chat

LiveZilla Live Help

Popular posts

Function strtok in C programming Check prime numbers in C Programming C Programming Union Linked Lists in C programming File Input/Output in C programming C Programming Enumeration

RSS-subscribe

New materials

Subscribe