C program for Creating below pattern.


#include<stdio.h>
int main()
{
int i,j,n;
printf("Enter number of rows:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<(n-i)-1;j++)
{
printf(" ");
}
for(j=0;j<i+1;j++)
{
printf("* ");
}
printf("\n");
}
}


***Input && Output***



Post a Comment

0 Comments