Skip to content

Commit 4d00a93

Browse files
Create HALF_PYRAMID.cpp
This will create half pyramid based on the given input
1 parent 2e57633 commit 4d00a93

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

C++/HALF_PYRAMID.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int rows;
7+
8+
cout << "Enter number of rows: ";
9+
cin >> rows;
10+
11+
for(int i = 1; i <= rows; ++i)
12+
{
13+
for(int j = 1; j <= i; ++j)
14+
{
15+
cout << "* ";
16+
}
17+
cout <<endl;
18+
}
19+
return 0;
20+
}

0 commit comments

Comments
 (0)