Probably the best idea would be to store the reversed number in a string before outputting it to the screen on-the-fly. That way you can manipulate the string anyway you want.
Or you could simply do the leading 0s check before you print out the char; you'd need a bool to keep track of whether you've hit a nonzero number, and if that's false, you basically discard any 0s.
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
Offline 5,055 posts
since Apr 2006