Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the method of drawing different shapes with stars?
for example:
n=5(number of rows)
*
**
***
****
*****
Posted
Comments
BrainlessLabs.com 23-Dec-11 12:28pm    
Please try it your self. Its a home work assignment I know of sure.

1 solution

For such a simple shape two annided loops and a printf are enough.
 
Share this answer
 
Comments
[no name] 23-Dec-11 12:10pm    
I didnt mean exactly this shape,I meant any shape for example diamond, house,... what is the exact solution?
CPallini 23-Dec-11 13:39pm    
The diamond too is very simple (two annided loops too, and, maybe, an if). However other shapes might be more complex. The recipe is: if the shape has a geometrical property then exploit it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900