Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Pattern-Problems/.DS_Store
Binary file not shown.
367 changes: 367 additions & 0 deletions Pattern-Problems/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
# Pattern-Problems

#### Pattern 1:

```
N = 4
1
1 1
1 1 1
1 1 1 1
```

#### Pattern 2:

```
N = 4
1
2 3
4 5 6
7 8 9 10
```
#### Pattern 3:

```
N = 4
1
2 3
3 4 5
4 5 6 7
```

#### Pattern 4:

```
N = 4
1 1 1 1
1 1 1
1 1
1
```

#### Pattern 5:

```
N = 4
1 2 3 4
1 2 3
1 2
1
```

#### Pattern 6:

```
N = 4
1
1 1
1 1 1
1 1 1 1
```

#### Pattern 7:

```
N = 4
1
2 3
4 5 6
7 8 9 10
```

#### Pattern 8:

```
N = 4
1
2 3
3 4 5
4 5 6 7
```

#### Pattern 9:

```
N = 4
1 1 1 1
1 1 1
1 1
1
```

#### Pattern 10:

```
N = 4
1 2 3 4
1 2 3
1 2
1
```

#### Pattern 11:

```
N = 4
A
B B
C C C
D D D D
```

#### Pattern 12:

```
N = 4
1 1 1 1
0 0 0
1 1
0
```

#### Pattern 13:

```
N = 4
D
C D
B C D
A B C D
```

#### Pattern 14:

```
N = 4
1
3 2
4 5 6
10 9 8 7
```

#### Pattern 15:

```
N = 4
A B C D D C B A
A B C C B A
A B B A
A A
```

#### Pattern 16:

```
N = 4
4 4 4 4
3 4 4 4
2 3 4 4
1 2 3 4
```

#### Pattern 17:

```
N = 4
0
1 0 1
2 1 0 1 2
3 2 1 0 1 2 3
4 3 2 1 0 1 2 3 4
```

#### Pattern 18:

```
N = 5 (N is always odd)
*
* *
* * *
* *
*
```

#### Pattern 19:

```
N = 5 (N is always odd)
*
* * *
* * * * *
* * *
*
```


#### Pattern 20:

```
N = 5 (N is always odd)
1
1 2 3
1 2 3 4 5
1 2 3
1
```


#### Pattern 21:

```
N = 4
1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
```


#### Pattern 22:

```
N = 5 #####(N is always odd)
*
* *
* * *
* *
*
```


#### Pattern 23:

```
N = 5
1
1 1
1 2 1
1 2 2 1
1 2 2 2 1
```


#### Pattern 24:

```
N = 4
1
1 1
2 0 2
3 0 0 3
```


#### Pattern 25:

```
N = 4
*
* * *
* * * * *
* * * * * * *
```


#### Pattern 26:

```
N = 4
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4
```


#### Pattern 27:

```
N = 5
5 4 3 2 *
5 4 3 * 1
5 4 * 2 1
5 * 3 2 1
* 4 3 2 1
```

#### Pattern 28:

```
N = 4
* 0 0 0 * 0 0 0 *
0 * 0 0 * 0 0 * 0
0 0 * 0 * 0 * 0 0
0 0 0 * * * 0 0 0
```



#### Pattern 29:

```
N = 5
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
1 2 3 4 5 5 4 3 2 1

```


#### Pattern 30:

```
N = 5 #####(N is always odd)
* * * * *
* * * *
* *
* * * *
* * * * *
```


#### Pattern 31:

```
N = 5
1 1
2 2
 3 3
4 4
5
4 4
 3 3
2 2
1 1
```


#### Pattern 32:

```
N = 5
1
2 3
4 5 6 7
8 9 1 2 3 4 5 6
7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4

```


#### Pattern 33:

```
N = 5
1 * * * * *
2 * * * *
3 * * *
4 * *
5 *
4 * *
3 * * *
2 * * * *
1 * * * * *

```
19 changes: 19 additions & 0 deletions Pattern-Problems/cpp/pattern01.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
using namespace std;

int main(){
cout<<"Enter n : ";
int n;
cin>>n;

//LOOP TO PRINT MULTIPLE ROWS
for(int row=1; row<=n; row++){
//WORK OF ONE ROW

//LOOP TO PRINT MULTIPLE COLUMNS
for(int col=1; col<=row; col++){
cout<<"1 ";
}
cout<<endl;
}
}
Loading