From e69c4d212ebcf2fbfb7819706f0376419852119e Mon Sep 17 00:00:00 2001 From: Tanmay Singh <98298849+tansin25@users.noreply.github.com> Date: Tue, 11 Oct 2022 19:40:37 +0530 Subject: [PATCH] Patterns (#190) [HF] * Create Tansin.txt * createdPrintZ.cpp First code * createdPrintZ My first code * createGradingSystem.cpp grading system code * MoreOfGettingStarted 5 more solutions of getting started * Patterns Patterns module --- .../Patterns/Pattern1.cpp | 14 ++++++++++ .../Patterns/Pattern2.cpp | 15 +++++++++++ .../Patterns/Pattern3.cpp | 20 ++++++++++++++ .../Patterns/Pattern4.cpp | 23 ++++++++++++++++ .../Patterns/Pattern5.cpp | 26 +++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern1.cpp create mode 100644 IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern2.cpp create mode 100644 IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern3.cpp create mode 100644 IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern4.cpp create mode 100644 IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern5.cpp diff --git a/IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern1.cpp b/IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern1.cpp new file mode 100644 index 00000000..9bdd6f92 --- /dev/null +++ b/IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern1.cpp @@ -0,0 +1,14 @@ +#include +using namespace std; + +int main(int argc, char **argv){ + int n; + cin >> n; + + for(int i=1;i<=n;i++){ + for(int j=1;j<=i;j++){ + cout<<"*\t"; + }cout< +using namespace std; + +int main(int argc, char **argv){ + int n; + cin >> n; + for(int i=n;i>=1;i--){ + for(int j=1;j<=i;j++){ + cout<<"*\t"; + }cout< +using namespace std; + +int main(int argc, char **argv){ + int n; + cin >> n; + for(int i=1;i<=n;i++) + { + for(int j=1;j<=n;j++) + { + if(j>=n+1-i) + cout<<"* "; + else + cout<<" "; + } + cout< +using namespace std; + +int main(int argc, char **argv){ + int n; + cin >> n; + + for(int i=n;i>=1;i--) + { + for(int j=1;j<=n;j++) + { + if(j>=n+1-i) + cout<<"* "; + else + cout<<" "; + } + cout< +using namespace std; + +int main(int argc, char **argv){ + int n; + cin >> n; + int s=n/2,a=1; +for(int i=1;i<=n;i++){ + for(int j=1;j<=s;j++){ + cout<<("\t"); + } + for(int j=1;j<=a;j++){ + cout<<("*\t"); + } + cout<