-
Notifications
You must be signed in to change notification settings - Fork 0
/
14-pattern-swastik.cpp
52 lines (48 loc) · 1.24 KB
/
14-pattern-swastik.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
using namespace std;
int main(){
int n;
cout << " Enter the size of one hand: "; cin >> n ; cout << endl;
for (int row = 1; row < 2*n; row++){
for (int col = 1; col < 2*n; col++){
if (row == 1){
if (col == 1 | col >= n){
cout << "* ";
}
else{
cout << " ";
}
}
else if (row > 1 & row < n){
if (col == n | col == 1){
cout << "* ";
}
else {
cout << " ";
}
}
else if (row == n){
cout << "* ";
}
else if (row > n & row < 2*n-1){
if(col==n | col == 2*n - 1){
cout << "* ";
}
else {
cout << " ";
}
}
else{
if(col >=n+1 & col < 2*n - 1){
cout << " ";
}
else {
cout << "* ";
}
}
}
cout << endl;
}
return 0;
}
// Mohammad Maasir | 03 September 2023, 16:38:11