Skip to content

Commit 59ab7b1

Browse files
authored
Create Floyds_Triangle.cpp
1 parent e9276ea commit 59ab7b1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Floyds_Triangle.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int rows, number = 1;
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 << number << " ";
16+
++number;
17+
}
18+
19+
cout << endl;
20+
}
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)