Posted by : Unknown
Wednesday, February 3, 2016
*
***
*****
*******
**
****
******
*******
******
****
**
*******
*****
***
*
*****
*******
**
****
******
*******
******
****
**
*******
*****
***
*
Ans:
#include<stdio.h>
int main()
{
int r,c,w,x,y,z;
for(r=1,z=1; r<=4; r++,z=z+2)
{
for(c=1; c<=z; c++)
printf("*");
printf("\n");
}
for(r=1,y=2; r<=3; r++,y=y+2)
{
for(c=1; c<=y; c++)
printf("*");
printf("\n");
}
for(r=1; r<=7; r++)
printf("*");
printf("\n");
for(r=1,x=6; r<=3; r++,x=x-2)
{
for(c=1; c<=x; c++)
printf("*");
printf("\n");
}
for(r=1,w=7; r<=4; r++,w=w-2)
{
for(c=1; c<=w; c++)
printf("*");
printf("\n");
}
return 0;
}
int main()
{
int r,c,w,x,y,z;
for(r=1,z=1; r<=4; r++,z=z+2)
{
for(c=1; c<=z; c++)
printf("*");
printf("\n");
}
for(r=1,y=2; r<=3; r++,y=y+2)
{
for(c=1; c<=y; c++)
printf("*");
printf("\n");
}
for(r=1; r<=7; r++)
printf("*");
printf("\n");
for(r=1,x=6; r<=3; r++,x=x-2)
{
for(c=1; c<=x; c++)
printf("*");
printf("\n");
}
for(r=1,w=7; r<=4; r++,w=w-2)
{
for(c=1; c<=w; c++)
printf("*");
printf("\n");
}
return 0;
}
**********OUTPUT**********
*
***
*****
*******
**
****
******
*******
******
****
**
*******
*****
***
*
***
*****
*******
**
****
******
*******
******
****
**
*******
*****
***
*
*************************
Related Posts :
- Back to Home »
- Star Patterns »
- 33.Taj Mahal Shape pyramid using *'s as shown below.