Skip to content

Commit

Permalink
Create FloyedTriangle.cpp
Browse files Browse the repository at this point in the history
Added The code for Floyed Triangle
  • Loading branch information
ooye-sanket authored Oct 1, 2023
1 parent 6dd682c commit cab3689
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Project/Cpp Progs/FloyedTriangle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
using namespace std;

int main() {

int rows, number = 1;

cout << "Enter number of rows: ";
cin >> rows;

for(int i = 1; i <= rows; i++) {
for(int j = 1; j <= i; ++j) {
cout << number << " ";
++number;
}

cout << endl;
}

return 0;
}

0 comments on commit cab3689

Please sign in to comment.