-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathDabang.cpp
More file actions
46 lines (36 loc) · 764 Bytes
/
Dabang.cpp
File metadata and controls
46 lines (36 loc) · 764 Bytes
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
#include <iostream>
using namespace std;
int main()
{
int n = 5;
int row = 1;
while(row<=n){
int col_1 = 1;
int col_2 = 1;
int count = 1;
while(col_1<=(n-row+1)){
cout << count << " ";
count++;
col_1++;
}
int star_1 = row-1;
while(star_1){
cout << "*" << " ";
star_1--;
}
int star_2 = row-1;
while(star_2){
cout << "*" << " ";
star_2--;
}
int count_2 = n+col_2-1;
while(col_2<=(n-row+1)){
cout << count_2 << " ";
count_2--;
col_2++;
}
cout<< endl;
row++;
}
return 0;
}