Skip to main content
C Program to print the star pattern 4
C Program to print the star pattern 4
*
* * *
* * * * *
#include<stdio.h>
int main()
{
int i,j,k=0;
for(i=0;i<3;i++)
{
printf("\n");
for(j=0;j<5;j++)
{
if(j>=2-i && j<=2+i)
{
printf("* ");
}
else
printf(" ");
}
}
}
Output:
Comments
Post a Comment