diff --git a/Floyd Triangle b/Floyd Triangle new file mode 100644 index 0000000..6635907 --- /dev/null +++ b/Floyd Triangle @@ -0,0 +1,20 @@ +#include +using namespace std; + +int main() { + int i, j, rows, counter; + + cout << "Enter the number of rows of Floyd's triangle\n"; + cin >> rows; + + // Print Floyd's triangle + for (counter = 1, i = 1; i <= rows; i++) { + // Print ith row + for (j = 1; j <= i; j++) { + cout << counter++ << " "; + } + cout << endl; + } + + return 0; +}