Commit 28b493f
committed
feat: Demonstrate use of break in while loop to stop iteration at specific condition
🧠 Logic:
- Starts printing numbers from 0 using a `while` loop.
- When the counter `i` reaches 500, the `break` statement terminates the loop immediately.
- Prints "Break and Continue" after exiting the loop.
Signed-off-by: Somesh diwan <[email protected]>1 parent 6a77f80 commit 28b493f
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
0 commit comments