#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.........