Next: Another Example
Up: Nested DO Loops
Previous: Approximation

Nested DO Loops

Quite often, it is useful to nest one DO loop inside of another. For example, consider the problem of approximating and displaying the square roots of the integers between 1 and 10. Take a look at ``sroot2.f'' (or view it directly). We are making use of the same SROOT function from the last example, but with a new main program.

In what sense does this program exhibit a nested loop?

Click here for the answer

Compile and run the program. You'll notice that it doesn't work. Try to figure out the problem before you look at the answer below.

Click here for the answer

Now that you know what the problem is, how can you fix it?

Click here for the answer


Next: Another Example
Up: Nested DO Loops
Previous: Approximation

Hamlet Project
hamlet@cs.utah.edu