No, I meant for loops and while loops vs do-while loops. Not that there was such a thing as a for-while loop.... lol.....

BTW, what about your program currently can't handle the n-digit scenario? You have a loop. It should work if your algorithm is correct (which I have some doubts about from looking at the loop).