If the number must be exactly 5 digits, you'd be better off reading the number as a string and passing it into your function. By reading an int, you have the possibility of an error on the read if they type in a non-digit character. Reading a string removes that possibility.
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
jimJohnson commented: Great helper +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
kvprajapati commented: Ha! ha.. HaPpY nEw YeAr sir :) +11
astala27 commented: Nice, you just express the algorithm +2
Jason Giggs commented: Nice One Walt +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
kvprajapati commented: True! +11
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
VernonDozier commented: Not sure why you're rolling your eyes, but good solution. :) :) :) +11
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
vedro-compota commented: + +1
jonsca commented: Make this post a sticky! +5
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Nick Evan commented: Yep. +16