PDA

View Full Version : triangle of symbols



chris200x9
March 1st, 2008, 12:48 AM
how would I make a right triangle specified to a users height in cpp i.e

5 =

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

aks44
March 1st, 2008, 12:55 AM
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
March 1st, 2008, 01:05 AM
thanx, sry.

dynamethod
March 1st, 2008, 02:38 AM
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
March 1st, 2008, 02:49 AM
Use a nested for loops.