Star Pyramid triangle Pattern Program in C
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int size=5;
int i,j,k;
clrscr();
for(i=size;i>=-size;i--)
{
for(j=1;j>=abs(i);j++)
{
printf(" ");
}
for(k=size;k>=abs(i);k--)
{
printf("*");
}
printf("\n");
}
getch();
}
No comments:
Post a Comment