Originally posted by Campbell Ritchie:
Does that hint really help, Rob? I think he is looking for something much simpler.
Well since it has to be done in a
single for loop, other than using recursion (which won't use a for loop at all) or an if statement (if i > X then count back), I fail to see an alternative.
All in all, I got it programmed with a loop body of two lines, one of which was just setting up the variable, the other printing it.