continue statement in for loop

C Programming Language / Loop control in C Language

1027

Program:

#include <stdio.h>
void main ()
{ 
int a ;
 
for(a = 1;  a <= 10; a++){
 
 	if( a == 5){
	 continue;
	 } 
  printf("value of a: %d\n", a);	 
} 
 
}

Output:

value of a: 1
value of a: 2
value of a: 3
value of a: 4
value of a: 6
value of a: 7
value of a: 8
value of a: 9
value of a: 10
Press any key to continue . . .

Explanation:

when the value of a reaches to 5 then its continue, for that 5 is not printed.

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.