"HARD WORK BEATS TALENT WHEN TALENT DOSEN'T WORK HARD."
"HARD WORK BEATS TALENT WHEN TALENT DOSEN'T WORK HARD."
continue statement is a keyword and we use continue statement inside the loops only.
If you want to skip the current iteration of the loop and want to begin the next iteration then we use continue statement.
continue;
#include<stdio.h> #include<conio.h> void main() { int i; clrscr(); for(i=1; i<=10; i++) { if(i==5) { continue; } printf("%d\n",i); } getch(); }
1 2 3 4 6 7 8 9 10
In above example we are skipping the iteration number 5 with the help of continue statement. This is the use of continue statement.