C++ Program to Print Floyd's Triangle

In this program, you'll learn to Floyd's Triangle.



Source Code
#include <iostream>
using namespace std;

int main()
{
    int i, j, c=1;
    for (i=0; i<4; i++)
    {
        for (j=0; j<=i; j++)
        {
            cout<< c << " ";
            c++;
        }
        cout<< "\n";
    }
    return 0;
}
Output
1
2 3
4 5 6
7 8 9 10