Skip to content

Commit ec0e7a9

Browse files
committed
Floyd triangle pattern
1 parent 2914f92 commit ec0e7a9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Patterns/FloydTrianglePattern.cpp

+20
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+
7+
int n = 4, num = 1;
8+
9+
for (int i = 0; i < n; i++)
10+
{
11+
for (int j = 1; j <= i + 1; j++)
12+
{
13+
cout << num << " ";
14+
num++;
15+
}
16+
cout << endl;
17+
}
18+
19+
return 0;
20+
}

Patterns/FloydTrianglePattern.exe

43.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)