From 43793d2ccec9ab9837465df1a5e96fd83b4c433a Mon Sep 17 00:00:00 2001 From: SAKETSINGH120 Date: Tue, 11 Jul 2023 23:18:29 +0530 Subject: [PATCH 1/3] New pattern added --- Pattern/Pattern.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Pattern/Pattern.md diff --git a/Pattern/Pattern.md b/Pattern/Pattern.md new file mode 100644 index 0000000..abc404b --- /dev/null +++ b/Pattern/Pattern.md @@ -0,0 +1,40 @@ + +#include +using namespace std; + +void printInvTriangle(int n) +{ + + for (int i = 0; i < n; i++) { + + int space = i; + + + for (int j = 0; j < 2 * n - i - 1; j++) { + + if (space) { + cout << " "; + space--; + } + else { + cout << "* "; + } + } + cout << endl; + } +} + +int main() +{ + printInvTriangle(5); + + return 0; +} + +Output + +* * * * * * * * * + * * * * * * * + * * * * * + * * * + * \ No newline at end of file From 4bf6f95256a918262354339e10cfcf427ff77a9b Mon Sep 17 00:00:00 2001 From: SAKETSINGH120 Date: Tue, 11 Jul 2023 23:36:20 +0530 Subject: [PATCH 2/3] name changed --- Pattern/{Pattern.md => pattern8.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Pattern/{Pattern.md => pattern8.md} (100%) diff --git a/Pattern/Pattern.md b/Pattern/pattern8.md similarity index 100% rename from Pattern/Pattern.md rename to Pattern/pattern8.md From 4affc4691cae1f685ecbc68e393a72eb9c0ef46d Mon Sep 17 00:00:00 2001 From: SAKETSINGH120 Date: Tue, 11 Jul 2023 23:39:08 +0530 Subject: [PATCH 3/3] Description added --- Pattern/pattern8.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Pattern/pattern8.md b/Pattern/pattern8.md index abc404b..d93fe2b 100644 --- a/Pattern/pattern8.md +++ b/Pattern/pattern8.md @@ -1,3 +1,4 @@ +Printing the inverted triangle pattern using for loop. #include using namespace std;