Input
Output
#include <iostream> using namespace std; int main() { int n=3, i, j, c = 1; cout << "Enter the no of rows for Floyd's triangle: "; cout << n << endl; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++) { cout << " " << c; c++; } cout << endl; } return 0; }