-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpattern.cpp
More file actions
52 lines (40 loc) · 762 Bytes
/
pattern.cpp
File metadata and controls
52 lines (40 loc) · 762 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
47
48
49
50
51
52
#include <iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter The No."<<endl;
cin>>n;
int i,ln,ts,ms,s,mb,b;
ts=1+(n-1)*2;
i=1;
while(i<=n)
{
ln=1;
while(ln<=i)
{
ms= 1+(ln-1)*2;
mb= (ts-ms)/2;
b=1;
while(b<=mb)
{
cout<<" ";
b=b+1;
}
s=1;
while(s<=ms)
{ cout<<"*";
s=s+1;
}
b=1;
while(b<=mb)
{
cout<<" ";
b=b+1;
}
}
cout <<endl;
ln=ln+1;
i=i+10;
}
}