Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: (untagged)
How do I print the following forms ?





shape1

*
* *
* * *
* * * *


-----
shape2


*
*
* *
* *
* *
*
*

shape3

*
*
* *
* *
* *
*
*

shape4


* * * *
* * *
* *
*



thanks!
Posted
Updated 2-Jun-11 10:00am
v2
Comments
BillW33 2-Jun-11 8:59am    
Can you provide more information, like what language you are using and any code you have tried so far.
Anshul R 3-Jun-11 7:38am    
Are you trying to get your homework done.?

Thank you all friends. I hope good luck.
 
Share this answer
 
try this:

for i=0;i<4;i++
{
     for j=0;j<i+1;j++>
     {

             printf("* ");
     }

      printf("\n");
}


if doesn't work change the loop..that is it...
 
Share this answer
 
v2
Comments
Tarun.K.S 2-Jun-11 10:15am    
Please use pre tags to make your code more readable.
It is just a matter of loops, possibly conditional sentences and printing to standard output. You know, you have to master every of the listed techniques in order to be a software developer.
 
Share this answer
 
v2

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