#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,a[30][30];
clrscr();
printf("Enter how many line : ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(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];
printf("%5d",a[i][j]);
}
printf("\n");
}
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........