Break and continue
The break statement is used to exit from a while, do-while, for, or switch structure. It can only be used inside the body of a for, while, do-while, or in switch statements. The break statement is written simply as a break; without any embed.
Continue to skip the remaining states in the body of for, while, or do-while structure. It proceeds with the next iteration of the loop. It can be used in a while loop, do-while loop, and for a loop.
Syntax
if(condition)
{
Continue;
}
If( condition)
{
Break;
}
printf(statement);
Structure
Program
QUESTION: write a c program using break and continue statement.
OUTPUT
enter a value of no: 7
1 2 4 5 6 7
0 Comments