Nearby lessons
47 of 124C - Break Statement
Learn the break statement in C — it immediately stops a loop (or a switch) and jumps to the code after it.
What is break?
break immediately stops the loop completely — the remaining iterations are skipped and execution continues after the loop.
Trainer's Memory Trick: break is the emergency exit — it leaves the building at once.
Break in a for Loop
Here the loop is supposed to run 5 times, but break stops it when i becomes 3:
Example02
break in while and switch
break works in while, do-while, for and switch. In a switch, break prevents fall-through to the next case:
Example03
📝 Key Takeaways
- break immediately stops the loop completely
- Execution continues after the loop
- break also prevents switch fall-through
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2