What could be the real life example of continue statement ?
I did google search but I couldn't found the real life example of continue statement in c programming.
I have looked some example but I can't figure if the statement are useful in program
Lets look this program from the book
Code:
// C program to explain the use // of continue statement
#include <stdio.h>
int main() {
// loop from 1 to 10
for (int i = 1; i <= 10; i++) {
// If i is equals to 6,
// continue to next iteration
// without printing
if (i == 6)
{
continue;
}
else
{
// otherwise print the value of i
printf("%d ", i);
}
}
return 0;
}
Program gives output
1 2 3 4 5 7 8 9 10
If I remove continue statement from the code. there is nothing change happen in program out
It gives same result as it was
1 2 3 4 5 7 8 9 10
What could be the real life example of continue statement ?