Skip to content

Commit

Permalink
Merge pull request #28 from diecoding0911/main
Browse files Browse the repository at this point in the history
pattern program Added by Tanish
  • Loading branch information
RoSPinoT authored Nov 19, 2022
2 parents 980c573 + 011d66a commit 1ef8f94
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Pattern.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <stdio.h>
int main()
{
int n, c, k;

printf("Enter number of rows\n");
scanf("%d", &n);

for (k = 1; k <= n; k++)
{
for (c = 1; c <= n-k; c++)
printf(" ");

for (c = 1; c <= 2*k-1; c++)
printf("*");

printf("\n");
}

for (k = 1; k <= n - 1; k++)
{
for (c = 1; c <= k; c++)
printf(" ");

for (c = 1 ; c <= 2*(n-k)-1; c++)
printf("*");

printf("\n");
}

return 0;
}

0 comments on commit 1ef8f94

Please sign in to comment.