Summary

There are a number of different ways of causing a C++ program to loop. while loops check a condition, and if it is true, execute the statements in the body of the loop. do...while loops execute the body of the loop and then test the condition. for loops initialize a value and then test an expression. If expression is true, the body of the loop is executed, as is the final statement in the for header. Each subsequent time through the loop, the expression is tested again. The goto statement is generally avoided, because it causes an unconditional jump to a seemingly arbitrary location in the code, thus making source code difficult to understand and maintain. continue causes while, do...while, and for loops to start over, and break causes while, do...while, for, and switch statements to end.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.214.141