triangle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariharanjp
    New Member
    • Feb 2008
    • 1

    #1

    triangle

    if we enter the input as 3.. it will show the output as below.. pl any one post for this using C.

    *
    **
    ***
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Please read the posting guidelines.


    I can help with specific programming and design issues but I cannot provide complete solutions or act as a tutor.

    Comment

    • Simonius
      New Member
      • Feb 2008
      • 47

      #3
      Just a loop, something allong the following lines should do the tricks.
      But please experiment with this yourself because if you want to advance you'll have to be capable of writing loops, especially easy ones.

      Code removed, please read our guidelines

      Basicly what you do is the following:
      you do the loop while the ammount of lines(i) doesn't equal the ammount that you entered.
      Since you want the same ammount of stars on that line as the line number it's a matter of using a second variable and while that variable is smaller then the line number printing a *, after that has happened you'll begin a new line.
      This'll continue untill all the lines have been printed.

      Comment

      Working...