Discussion:
Q: How to eliminate a break statement from a for loop
Using the following code as an example, explain how, in general, one can remove the break statement and replace it with "better" code:
int count; for (count = 1; count <= 10 ; ++count) { if (count == 5) break; // LINE 5 };
Suppose we replace the line labeled "LINE 5" with a continue statement. How would you replace the early termination code with "better" structured code?