Lesson 10: Nested Loops

Homework: http://beginnerscpp.com/forums/index.php/topic,63.0.html



Nested Loops
In this lesson I threw you guys straight into the deep end. The basic concept of nested loops is the same as a nested if statement, you have an inner loop that will complete all of it’s instructions every time through the outer loop (unless there is a break statement somewhere). Here’s an example:

As you can see in the example, the inner loop is running fully every time the outer loop iterates.

Lesson 9: For / While loop
Lesson 11: Case study – Using loops to make a simple number guessing game