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