Daniel Brackett wrote:How does one check the exit path? what is the exit path?
How does one check the exit path? what is the exit path?
Michael Krimgen wrote:by the way, is it an exercise to practise recursion?
Otherwise, I believe that a single for-loop would do the job and the code would be easier to understand an debug. :-)
Michael Krimgen wrote:how about
I don't want to do your work here...
Campbell Ritchie wrote:Challenge: Now do it without using % 5. You only need one % operator. You do need two loops, but miss out most of the % tests which will come out false.
Campbell Ritchie wrote:Not bad. I shall have to think about that one. Is it a version of the sum of an arithmetical progression?
Campbell Ritchie wrote:Yes, 1 + 2 + 3 +...+ n is an arithmetical progression, as is 3 + 9 + 12 ... + n. What do you do about duplicates, eg 15?
Daniel Brackett wrote: