it's been decades since i've done any real programming or written a flow chart so no idea if number is the same as &number& in your flow chart but everything looks fine as far as you've gotten.
first thing's i'd do is to add in some error checks to make it idiot proof, that way it will work without any unexpected results or errors.
"please input a whole number from 1 to 1000" number
check number doesn't contain any characters not allowed, letters or decimal points etc.
if yes it does output "sorry only whole numbers from 1 to 1000 allowed, try again" jump back to start.
if no carry on and check number =>1 or =<1000 if no output above message, jump back to start.
if yes carry on and check length of number,
if yes more than a single digit, truncate it to last digit only and then follow your flowchart. (other wise 21st will output 21th with your flowchart.)
if no carry on and follow your flowchart
now your flowchart will work with 1 exception numbers ending in 0's, 10,20,etc.
so the first check should be is the number >3 or does the number=0
now everything will work and no-one can deliberately or accidentally make your program crash or give an incorrect output.
hope that helps you.
Edited by terry1966, 01 May 2015 - 09:41 AM.