Originally posted by Campbell Ritchie:
Another way is to set up a recursion using the integer divide / and remainder % operations. I would prefer that way for an exercise myself.
In the old Tenex world, that was a common code sample fragment. At first, it was called "decout" (for decimal out) and you could change the constant that you do the div and mod by to convert it to octal, hex, etc.
later jargon file called it yornp for Ye Olde Recursive Number Printer.
Anyone claiming to speak PDP-10, Tenex, TOPS-10 or TOPS-20 was expected to know it by heart.