Skip to content

Commit

Permalink
Patterns (#190) [HF]
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tansin25 authored Oct 11, 2022
1 parent f8d3a0f commit e69c4d2
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
14 changes: 14 additions & 0 deletions IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>
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<<endl;
}
return 0;
}
15 changes: 15 additions & 0 deletions IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <iostream>
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<<endl;
}
return 0;


}
20 changes: 20 additions & 0 deletions IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
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<<endl;
}
return 0;
}

23 changes: 23 additions & 0 deletions IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
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<<endl;
}
return 0;
}



26 changes: 26 additions & 0 deletions IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <iostream>
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<<endl;
if(i<=n/2){
s--;
a=a+2;
}
else{
s++;
a=a-2;
}
}
return 0;
}

0 comments on commit e69c4d2

Please sign in to comment.