Skip to main content

8.3) Exercise 5: Solution


You can obtain a solution by entering the code into your computer, compiling it and running it.

The results of running the code are listed on the next page.

This is the output that results from running the example 13 code. Was it what you expected?

           1
           1           1
           1           2
           1           3
           2
           2           1
           2           2
           2           3
           3
           3           1
           3           2
           3           3

A video on the next page explains what happens in the code to get this result. Please view it even if you got the correct answer.