From 88c6fc0b61e0c57527e5b8db15727073e4eb75e4 Mon Sep 17 00:00:00 2001 From: Harsh Kesarwani <77579808+harshkcodes@users.noreply.github.com> Date: Wed, 5 May 2021 22:20:24 +0530 Subject: [PATCH 1/2] Create pattern6.cpp --- HarshKesarwani/pattern6.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 HarshKesarwani/pattern6.cpp diff --git a/HarshKesarwani/pattern6.cpp b/HarshKesarwani/pattern6.cpp new file mode 100644 index 000000000..b9a2b0d64 --- /dev/null +++ b/HarshKesarwani/pattern6.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; + +int main() +{ + cout << endl; + for (int x = 1; x <= 5; x++) + { + for (int y = 1; y <= x; y++) + { + cout << y; + } + for (int y = 1; y <= 9 - x * 2; y++) + { + cout << " "; + } + for (int y = x; y >= 1; y--) + { + if (y != 5) + { + cout << y; + } + } + cout << endl; + } + cout << endl; + return 0; +} From 133d6aae3d85bd1c2226d737d209cec7596b2d76 Mon Sep 17 00:00:00 2001 From: Harsh Kesarwani <77579808+harshkcodes@users.noreply.github.com> Date: Thu, 6 May 2021 23:26:36 +0530 Subject: [PATCH 2/2] Create pattern7.cpp --- HarshKesarwani/pattern7.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 HarshKesarwani/pattern7.cpp diff --git a/HarshKesarwani/pattern7.cpp b/HarshKesarwani/pattern7.cpp new file mode 100644 index 000000000..2d70c5118 --- /dev/null +++ b/HarshKesarwani/pattern7.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; + +int main() +{ + cout << endl; + for (int x = 1; x <= 5; x++) + { + for (int y = 1; y <= 5; y++) + { + if (y == 1 || y == 5 || x == y) + { + cout << "*"; + } + else + { + cout << " "; + } + } + cout << endl; + } + cout << endl; + return 0; +}