exercise 30 iterative sum