From 63c7664e6fd4d243d44c97f02b1caa57604d0e52 Mon Sep 17 00:00:00 2001 From: ankur-jat0009 Date: Tue, 21 May 2024 13:28:20 +0530 Subject: [PATCH 1/2] update files --- README.md | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/README.md b/README.md index 7cab4d9..bc49ed2 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,153 @@ Doing pattern problem question in C and C++ 2 3 4 5 6 7 8 9 10 + + +20. + + ******* + * * + * * + * * + * * + * * + ******* + +21. + + ***** ***** + **** **** + *** *** + ** ** + * * + * * + ** ** + *** *** + **** **** + ***** ***** + +22. + + * + * * + * * + * * + * * + * * + * * + * * + * * + * + +23. + + 1 + 2*2 + 3*3*3 + 4*4*4*4 + 5*5*5*5*5 + 6*6*6*6*6*6 + 7*7*7*7*7*7*7 + +24. + + A + ABA + ABCBA + ABCDCBA + ABCDEDCBA + ABCDEFEDCBA + ABCDEFGFEDCBA + +25. + + 1 + 12 + 1 3 + 1 4 + 1 5 + 1 6 + 1234567 + +26. + + 1234567 + 2 7 + 3 7 + 4 7 + 5 7 + 67 + 7 + +27. + + ********1******** + *******2*2******* + ******3*3*3****** + *****4*4*4*4***** + ****5*5*5*5*5**** + ***6*6*6*6*6*6*** + **7*7*7*7*7*7*7** + *8*8*8*8*8*8*8*8* + 9*9*9*9*9*9*9*9*9 + +28. + + 1 + 121 + 12321 + 1234321 + 123454321 + 12345654321 + 1234567654321 + +29. + + 1 + 2*3 + 4*5*6 + 7*8*9*10 + 11*12*13*14*15 + 11*12*13*14*15 + 7*8*9*10 + 4*5*6 + 2*3 + 1 + + +30. + + 1 + 1 1 + 1 2 1 + 1 3 3 1 + 1 4 6 4 1 + 1 5 10 10 5 1 + 1 6 15 20 15 6 1 + +31. + + 1 + 123 + 12345 + 1234521 + 123454321 + 12345 + 123 + 1 + +32. + + * * + ** ** + *** *** + **** **** + ********** + ********** + **** **** + *** *** + ** ** + * * From 13a7180538684c738bc23b67d288af9a67d78eb3 Mon Sep 17 00:00:00 2001 From: Ankur-Jat <146361526+ankur-jat0009@users.noreply.github.com> Date: Tue, 21 May 2024 13:35:47 +0530 Subject: [PATCH 2/2] Add more files --- pattern20.cpp | 19 +++++++++++++++++++ pattern21.cpp | 33 +++++++++++++++++++++++++++++++++ pattern22.cpp | 39 +++++++++++++++++++++++++++++++++++++++ pattern23.cpp | 18 ++++++++++++++++++ pattern24.cpp | 18 ++++++++++++++++++ pattern25.cpp | 18 ++++++++++++++++++ pattern26.cpp | 16 ++++++++++++++++ pattern27.cpp | 23 +++++++++++++++++++++++ pattern28.cpp | 31 +++++++++++++++++++++++++++++++ pattern29.cpp | 32 ++++++++++++++++++++++++++++++++ pattern30.cpp | 15 +++++++++++++++ pattern31.cpp | 20 ++++++++++++++++++++ pattern32.cpp | 26 ++++++++++++++++++++++++++ 13 files changed, 308 insertions(+) create mode 100644 pattern20.cpp create mode 100644 pattern21.cpp create mode 100644 pattern22.cpp create mode 100644 pattern23.cpp create mode 100644 pattern24.cpp create mode 100644 pattern25.cpp create mode 100644 pattern26.cpp create mode 100644 pattern27.cpp create mode 100644 pattern28.cpp create mode 100644 pattern29.cpp create mode 100644 pattern30.cpp create mode 100644 pattern31.cpp create mode 100644 pattern32.cpp diff --git a/pattern20.cpp b/pattern20.cpp new file mode 100644 index 0000000..7b6605a --- /dev/null +++ b/pattern20.cpp @@ -0,0 +1,19 @@ +#include +using namespace std; + +int main(){ + int n; + cin>>n; + for(int i =0;i +using namespace std; + +int main(){ + int n; + cin>>n; + for(int i =0;i +using namespace std; + +int main(){ + int n; + cin>>n; + // upper + for(int i =0;i +using namespace std; + +int main(){ + int n; + cin>>n; + for(int i =0;i +using namespace std; +int main(){ + int n; + cin>>n; + for(int i =0;i'A';){ + t=t-1; + cout< +using namespace std; +int main(){ + int n; + cin>>n; + for(int i =0;i +using namespace std; +int main(){ + int n; + cin>>n; + for(int i =0;i +using namespace std; +int main(){ + int n; + cin>>n; + for(int i=0;i 0){ + cout< +using namespace std; +int main(){ + int n; + cin>>n; + int k=n; + for(int i=0;i +using namespace std; + +int main(){ + int n; + cin>>n; + int c=1; + for(int i =0;i +using namespace std; + +int main(){ + int n; + cin>>n; + for(int i =1;i<=n;i++){ + int c=1; + for(int j=1;j<=i;j++){ + cout<< c<<" " ; + c=c*(i-j)/j; + } + cout< +using namespace std; +int main(){ + int n; + cin>>n; + for(int i =0;i +using namespace std; + +int main(){ + int n; + cin>>n; + for(int i=0;i<2*n;i++){ + int cond = i0){ + cout<<" "; + space_count--; + } + else{ + cout<<"*"; + } + } + cout<