Skip to content

Commit

Permalink
Merge pull request #144 from sanketkalekar/patch-1
Browse files Browse the repository at this point in the history
Create FloyedTriangle.cpp
  • Loading branch information
Ananyasingh2002 authored Oct 1, 2023
2 parents 66efb3e + cab3689 commit 680cd3c
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 680cd3c

Please sign in to comment.