Skip to content

Commit

Permalink
Merge pull request #22 from Adishri24/main
Browse files Browse the repository at this point in the history
adding a c file of pattern
  • Loading branch information
RoSPinoT authored Nov 19, 2022
2 parents 78a5bf6 + 474cbc8 commit 5b47377
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pattern.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <stdio.h>

int main()
{
int n,m;
printf("Enter the number of rows");
scanf("%d",&n);
m=n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m-1;j++)
{
printf(" ");
}
for(int k=1;k<=2*i-1;k++)
{
if(k==1 || k==2*i-1 || i==n)
printf("*");
else
printf(" ");
}
m--;

printf("\n");
}
return 0;
}

0 comments on commit 5b47377

Please sign in to comment.