Star Pattern in the form of pyramid
// *
// **
// ***
// ****
// ***
// **
// *
#include<stdio.h>
int main()
{ int a,b,c,d,e;
printf("Enter the Number till you get the Pattern:\n");
scanf("%d",&a);
for(b=0;b<a;b++)
{ for(c=0;c<b+1;c++)
{ printf("* ");
}
printf("\n");
}
for (e=0;e<a;e++)
{ for (d=a;d>e+1;d--)
{ printf("* ");
}
printf("\n");
}
return 0;}
Comments
Post a Comment