There's no need for any if-else statements. They add to the clutter of the code and make it more difficult to debug. Calculate all 5 digits right away and just print them out.

You're running into...