Originally Posted by Daved
Each digit of a number is a character in the output, so a two digit number will take up two digits instead of one. That is why your output looks funny (I assume that's your problem since the code works fine otherwise for me).
I think the output is fine the way it is, but if you want to change it, you'll have to figure out how many characters the largest value will be and make sure each value printed uses that many characters. For example, for a starting point of 5, the largest value is 10. When you print out the one-digit numbers, they should all be "01" or " 1" so that they all take up two characters.