MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/pattern/Heart_pattern.cpp:5–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3using namespace std;
4
5int main()
6{
7
8 int a, b, size = 15;
9
10
11 for (a = size/2; a <= size; a = a+2)
12 {
13
14 for (b = 1; b < size-a; b = b+2)
15 cout<<" ";
16
17
18 for (b = 1; b <= a; b++)
19 cout<<"A";
20
21
22 for (b = 1; b <= size-a; b++)
23 cout<<" ";
24
25 // FOR PRINTING PEAK-2 : PART 4
26 for (b = 1; b <= a-1; b++)
27 cout<<"A";
28
29 cout<<endl;
30 }
31
32
33 for (a = size; a >= 0; a--)
34 {
35
36 for (b = a; b < size; b++)
37 cout<<" ";
38
39
40 for (b = 1; b <= ((a * 2) - 1); b++)
41 cout<<"B";
42
43 cout<<endl;
44 }
45}
46

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected