main()
{
int m=3,i,j,k,n=1;
clrscr();
for(i=1;i<=5;i++)
{
for(k=1;k<=m;k++)
{
printf(" ");
}
for(j=1;j<=n;j++)
{
printf("* ");
}
printf("\n");
if(i>=3)
{
m=m+1;
n=n-1;
}
else
{
m=m-1;
n=n+1;
}
}
getch();
return 0;
}
No comments:
Post a Comment