Exercise 26

Rewrite the exercise 24, by using the While loop.