Next: Exercise. Up: More about loops. Previous: Labeled break and continue statements.
These constructs we've discussed today - the do loop, the continue statement, and the labeled break statement are much less frequently used than the other loop concepts we've discussed so far. To get a feel for how useful they are, I counted how often different statements occurred in the code for Logisim and the 150 CPU simulator, which together contain 12,000 lines of code.
| while loop | 122 times |
| for loop | 120 times |
| do loop | 0 times |
| break statement | 166 times |
| continue statement | 3 times |
| labeled break or continue | 0 times |
Next: Exercise. Up: More about loops. Previous: Labeled break and continue statements.