PDA

View Full Version : triangle of symbols


chris200x9
February 29th, 2008, 07:48 PM
how would I make a right triangle specified to a users height in cpp i.e

5 =

*
**
***
****
*****

aks44
February 29th, 2008, 07:55 PM
I don't mean to be rude, but you asked almost the exact same question a few days ago.

The differences between the two are so basic that I wonder if you even made the effort to understand the answer that was given the other day...

As far as I'm concerned, I smell homework (http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2) (very basic, at that).

chris200x9
February 29th, 2008, 08:05 PM
thanx, sry.

dynamethod
February 29th, 2008, 09:38 PM
i'll give you an idea about how you can get there

write some code that will produce:

xxxxx

then modify it so it produces this:

xxxxx
xxxxx
xxxxx
xxxxx
xxxxx

then modify it again to produce this:

x
xx
xxx
xxxx
xxxxx

LittleLORDevil
February 29th, 2008, 09:49 PM
Use a nested for loops.