C Program to print star pattern pyramid
Posted by Raj
C Program to print star pattern pyramid form
In this article,I will show how to write C program to print Star Pattern pyramid form.
Example: Print Star pattern in C
#include
#include
void main()
{
int s=5,a,b,c,n=0;
clrscr();
for(a=1; a<=s; a++)
{
if(a%2!=0)
{
n=(s-a)/2;
for(c=0; c
{
printf<<(" ");
}
for(b=0; b
{
printf<<(" * ");
}
printf<<("\n");
}
}
getch();
}
OUTPUT:
*
* * *
* * * * *
In this article,I will show how to write C program to print Star Pattern pyramid form.
Example: Print Star pattern in C
#include
#include
void main()
{
int s=5,a,b,c,n=0;
clrscr();
for(a=1; a<=s; a++)
{
if(a%2!=0)
{
n=(s-a)/2;
for(c=0; c
{
printf<<(" ");
}
for(b=0; b
{
printf<<(" * ");
}
printf<<("\n");
}
}
getch();
}
OUTPUT:
*
* * *
* * * * *
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
C Program to print star pattern,
star pattern in C
.You can leave a response, or trackback from your own site.