Skip to content

Commit 493e35d

Browse files
Create EquilateralTriangle.cpp
1 parent 448ae9c commit 493e35d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

EquilateralTriangle.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
int main() {
6+
for (int i = 0; i < 10; i++)
7+
{
8+
// Left side
9+
for (int j = 0; j < 10-i; j++)
10+
{
11+
cout << " ";
12+
}
13+
for (int j = 0; j < i; j++)
14+
{
15+
cout << "*";
16+
}
17+
18+
19+
// Right Side
20+
for (int j = 0; j < i; j++)
21+
{
22+
cout << "*";
23+
}
24+
cout << endl;
25+
}
26+
27+
return 0;
28+
}

0 commit comments

Comments
 (0)