forked from IEEE-NITK/HacktoberFest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatternprinter.txt
More file actions
60 lines (49 loc) · 800 Bytes
/
Copy pathPatternprinter.txt
File metadata and controls
60 lines (49 loc) · 800 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
53
54
55
56
57
58
59
#include <iostream>
using namespace std;
int main()
{ int r,l,p=0,x=1,y;
cout<< "enter no of rows=columns (should be odd)\n";
cin>>r;
l=(r-1)/2;
y=r-2;
for(int z=l;z>=1;z--)
{
for(int i=1;i<=z;i++)
{
cout<<".";
}
for(int j=1;j<=x+p;j++)
{
cout<<"*";
}
for(int i=1;i<=z;i++)
{
cout<<".";
}
p++;x++;
cout<<endl;
}
for(int k=r;k>=1;k--)
{cout<<"*";
}
cout<<endl;
p=0;
for(int o=1;o<=l;o++)
{
for(int t=1;t<=o;t++)
{
cout<<".";
}
for(int u=y-p;u>=1;u--)
{
cout<<"*";
}
for(int t=1;t<=o;t++)
{
cout<<".";
}
p++;y--;
cout<<endl;
}
return 0;
}