#include<iostream>
using namespace std;
int main()
{
    int a[10][10],i,j;
    for(i=0;i<10;i++)
     a[i][0]=1,a[i][i]=1;
    for(i=2;i<10;i++)
        for(j=1;j<i;j++)
            a[i][j]=a[i-1][j-1]+a[i-1][j];
    for(i=0;i<10;i++)
        {
            for(j=0;j<=i;j++)
                cout<<a[i][j]<<" ";
            cout<<endl;
        }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: