In this tutorial you will learn about difference between break and continue in C.
The break statement is used in switch or loops and continue statement is used only in loops. When break statement is encountered it immediately stops the switch or loop execution. When continue statement is encountered, all the statements next to it are skipped and the loop control goes to next iteration. Generally we use break and continue with some condition.
Below I have shared difference between break and continue statements along with an example in C.
Difference Between break a5knd continue in C
|1.||break statement is used in switch and loops.||continue statement is used in loops only.|
|2.||When break is encountered the switch or loop execution is immediately stopped.||When continue is encountered, the statements after it are skipped and the loop control jump to next iteration.|
0 1 2
0 1 2 4
If you have any doubts related to above difference between break and continue tutorial then feel free to ask it by commenting below.
2 thoughts on “Difference Between break and continue in C”
please published more about c++
hello sir, i want some help with one of the code i am working in C. Can you share your e mail address or something so that we can discuss about it?