1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pascal triangle

Discussion in 'C' started by hoda, Feb 28, 2009.

  1. hoda

    hoda New Member

    Joined:
    Feb 17, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    somebody help me!! i didnt understand C++ completely and now i have to give my homework to the teacher.I need the answers for emergency.please help me to answer these questions:
    1-make a program that take one number and print this picture in the middle of the page:
    for example :4 *
    * *
    * * *
    * * * *
    first star should be printed in the forteenth column.
    2-make a program that unscramble the accepted number. for example :16482:12468
     
  2. hoda

    hoda New Member

    Joined:
    Feb 17, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Re: C++ Tutorial I

    *
    * *
    * * *
    * * * *
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    hoda, please do not jump into any article with your homework help and try creating a new thread for your query with proper explanation of what you have tried and where you are stuck.
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    We don't do homework, sorry. We'll help you learn though.
    How far have you got with your programs?
    Can you see what needs doing in terms of what loop(s) may be needed?

    It's useful to break it down into easier tasks; that's how I solve complicated problems. So for example I might start with a program that just displays 5 asterisks in a line (using a loop, not cheating with a single printf). Then I might adjust that to print any number of asterisks in a line.
    Then you need to modify it to print multiple lines up to a fixed number.
    Then it's just a case of getting that number from the user.

    For 2 that's just a simple sort routine.

    You'll probably have everything you need in the course notes you've got so far. Relax, don't panic, and let us know where you get stuck.
     
    shabbir likes this.
  5. hoda

    hoda New Member

    Joined:
    Feb 17, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    thanks for your guidance
     

Share This Page