Just as with Do While loops, we can nest one for loop inside another. This is very common when dealing with 2-dimensional arrays | |
For each iteration of the outer loop executes, we start the inner loop over again. | |
We can show this graphically by drawing a box around the inner loop: | |
These are equivalent: | |
How many squids does this print? |
How many squids does this print? |
What does this print? |
What does this print? |