What is the use of continue statement ? Explain with an example
Q. What is the use of continue statement ? Explain with an example.
ANS. Continue statement is mostly used inside loops. Whenever it is encountered inside a loop, control directly jumps to the beginning of the loop for next iteration, skipping the execution of statements inside loop’s body for the current iteration.
How this is used inside program?
Example: continue statement inside for loop
for (int j=0; j<=8; j++)
printf("%d ", j);
0 1 2 3 5 6 7 8