When continue encountered inside any loop, control automatically passes to the beginning of the loop.
It is used when we want to take the control to the beginning of the loop, bypassing the statement inside the loop.
Write a program to print 1 to 10 numbers on display but numbers divisible by 2 should not be display. We can see in below C program the printf() statement is bypassing inside the loop whenever variable becomes divisible by 2..
#include<stdio.h> int main() { int count;for (count = 1; count <= 10; count++) { if (count%2 == 0) { continue; } printf(“%d \t”,count); } } When continue encountered inside any loop, control automatically passes to the beginning of the loop, the output is :- |