Write a program that display Pascal pyramid. 1 2 1 3 3 1 4 6 4 1 5 10 10 5 1

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int n,a[30][30];
    clrscr();
    cout<<"Enter how many line : ";
    cin>>n;
   
    for(int i=0;i<n;i++)
    {
       for(int j=0;j<=i;j++)
       {
          if(j==0)
             a[i][j]=i+1;
          else if(i==j)
         a[i][j]=1;
          else
         a[i][j]=a[i-1][j-1]+a[i-1][j];
          cout<<"     "<<a[i][j];
       }
       cout<<"\n";
    }
    getch();
}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........