Here's a suggestion. It's not meant to be derogatory; but a serious suggestion. If you plan to be a programmer, as opposed to a hobbyist, then you need to understand this: understand, specify, and design before you ever think about pounding out code. Think about your requirements. From what I can tell, from your post, you want to begin with 5 digits, print them, remove one digit, print that, and wash, rinse, and repeat until you have exhausted all the digits. Further, you apparently want them to be right-aligned. Think about how you remove one digit; there are a number of possibilities. Think about how you force right alignment (formatting? forcible inclusion of a space?). Think about if you want to deal with the number as a character representation of a number all the way through, or only at the end (the output process). Use pseudo-code. Use a flowchart. Use anything which your humanly abstract reasoning abilities can deal with and massage into the less abstract ways you have to deal with your Von Neumann machine and whatever language you are trying to use to beat it into submission. To even contemplate coding before you do this is the sign of a novice, a poorly trained programmer, or (even worse) a schlock.