Nearby lessons

36 of 72

C - 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
Loading editor…

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
Loading editor…
📝 Key Takeaways
  • break immediately stops the loop completely
  • Execution continues after the loop
  • break also prevents switch fall-through

🧠 Test Your Knowledge

2 Questions
Progress: 0 / 2

Finished this lesson?

Mark it as complete to track your progress and see technology completion stats.