-
Notifications
You must be signed in to change notification settings - Fork 357
Expand file tree
/
Copy pathdabang_pattern.cpp
More file actions
37 lines (32 loc) · 824 Bytes
/
dabang_pattern.cpp
File metadata and controls
37 lines (32 loc) · 824 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
/*
1 2 3 4 5 5 4 3 2 1
1 2 3 4 * * 4 3 2 1
1 2 3 * * * * 3 2 1
1 2 * * * * * * 2 1
1 * * * * * * * * 1
*/
#include<iostream>
using namespace std;
int main()
{
int n=0;
cout<<"Enter the no of rows : ";
cin>>n;
for(int row=1;row<=n;row++)
{
/* 1st Triangle */
for(int i=1;i<=n-row+1;i++)
cout<<i<<"\t";
/* 1st Space Angle */
for(int j=row-1;j>0;j--)
cout<<"*"<<"\t";
/* 2nd Space angle */
for(int l=row-1;l>=1;l--)
cout<<"*"<<"\t";
/* 2nd Triangle */
for(int k=n-row+1;k>=1;k--)
cout<<k<<"\t";
cout<<endl;
}
return 0;
}