Exercise 1.11

Exercise 1.11 iterative and recursive solutions.