From 4fa249a58f1196dea4346bed44e260ca1085a046 Mon Sep 17 00:00:00 2001 From: Komal Gupta Date: Tue, 25 May 2021 12:25:05 +0530 Subject: [PATCH 1/4] Create pyramid_pattern.cpp --- patterns/pyramid_pattern.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patterns/pyramid_pattern.cpp diff --git a/patterns/pyramid_pattern.cpp b/patterns/pyramid_pattern.cpp new file mode 100644 index 0000000..57b6c16 --- /dev/null +++ b/patterns/pyramid_pattern.cpp @@ -0,0 +1,26 @@ +/* +Enter the number of rows: 6 + * + * * * + * * * * * + * * * * * * * + * * * * * * * * * +* * * * * * * * * * * +*/ +#include +void main() { + int i, a, rows, k = 0; + printf("Enter the number of rows: "); + scanf("%d", &rows); + for (i = 1; i <= rows; i++, k = 0) { + for (a= 1; a <=rows-i; a++) { + printf(" "); + } + while (k != 2 * i - 1) { + printf("* "); + k++; + } + printf("\n"); + } + +} From 6cc0c7b2c5a7c2b621788896eea5becd48591733 Mon Sep 17 00:00:00 2001 From: Komal Gupta Date: Tue, 25 May 2021 13:39:57 +0530 Subject: [PATCH 2/4] Rename number_half_pyramid.cpp to number_half_pyramid.c --- patterns/{number_half_pyramid.cpp => number_half_pyramid.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patterns/{number_half_pyramid.cpp => number_half_pyramid.c} (100%) diff --git a/patterns/number_half_pyramid.cpp b/patterns/number_half_pyramid.c similarity index 100% rename from patterns/number_half_pyramid.cpp rename to patterns/number_half_pyramid.c From a65fe064d949efa63ef11681a54dc153bb227db9 Mon Sep 17 00:00:00 2001 From: Komal Gupta Date: Tue, 25 May 2021 13:40:21 +0530 Subject: [PATCH 3/4] Rename pyramid_pattern.cpp to pyramid_pattern.c --- patterns/{pyramid_pattern.cpp => pyramid_pattern.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patterns/{pyramid_pattern.cpp => pyramid_pattern.c} (100%) diff --git a/patterns/pyramid_pattern.cpp b/patterns/pyramid_pattern.c similarity index 100% rename from patterns/pyramid_pattern.cpp rename to patterns/pyramid_pattern.c From abf9b60c48bbbf917dd873de84c4c53bc8fbeecd Mon Sep 17 00:00:00 2001 From: Komal Gupta Date: Tue, 25 May 2021 13:40:37 +0530 Subject: [PATCH 4/4] Rename reverse_half_pyramid to reverse_half_pyramid.c --- patterns/{reverse_half_pyramid => reverse_half_pyramid.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patterns/{reverse_half_pyramid => reverse_half_pyramid.c} (100%) diff --git a/patterns/reverse_half_pyramid b/patterns/reverse_half_pyramid.c similarity index 100% rename from patterns/reverse_half_pyramid rename to patterns/reverse_half_pyramid.c