1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Need suggestions

Discussion in 'C' started by karun_happy, Dec 14, 2006.

  1. karun_happy

    karun_happy New Member

    can anyone tell me the logic or source code of the program whose out put is like
                                   5  4  3  2  1
                                       4  3  2  1
                                           3   2 1
                                                2 1
  2. shabbir

    shabbir Administrator Staff Member

    You should start some coding at least
  3. pradeep

    pradeep Team Leader

    Yes, try at least, and post it here when you get stuck.
    It's quite easy, try printing this first.

  4. DaWei

    DaWei New Member

    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.
  5. pradeep

    pradeep Team Leader

    Very good suggestion DaWei. :)

Share This Page