can anyone tell me the logic or source code of the program whose out put is like Code: 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 THans
Yes, try at least, and post it here when you get stuck. It's quite easy, try printing this first. 1 12 123 1234 12345
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.