From b0c5b754edecf5eafeb87ed3f774cbcb075a29aa Mon Sep 17 00:00:00 2001 From: sau1rav <92566690+sau1rav@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:46:51 +0530 Subject: [PATCH] Create Diamond_Pattern_C++ --- Patterns/Diamond_Pattern_C++ | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Patterns/Diamond_Pattern_C++ diff --git a/Patterns/Diamond_Pattern_C++ b/Patterns/Diamond_Pattern_C++ new file mode 100644 index 00000000..4b3bb042 --- /dev/null +++ b/Patterns/Diamond_Pattern_C++ @@ -0,0 +1,28 @@ +/* In this programme the user have to enter the number of rows for the diamond dimenson to print the dimond patter as he wishes*/ + +#include +using namespace std; +int main() +{ +int n, x, i, j; +cout << "Enter number of rows: "; //user have to enter the number of rows here +cin >> n; +for(i = 0; i <= n; i++) +{ +for(x = n; x > i; x--) +cout << " "; +for(j=0; j i; j--) +cout << "* "; +// After each row ending the line +cout << "\n"; +} +return 0; +}