#include<conio.h>
#include<stdio.h>
void main()
{
staticint a[100][100],i,j,d;
clrscr();
printf("ENTER THE ELEMENT .....");
scanf("%d",&d);
for(i = 0;i < d; i++)
{
for(j = 0; j <= i; j++)
{
if(i==0 && j==0)
{
a[i][j] = 1;
}
else
a[i][j] = a[i-1][j-1] + a[i-1][j];
printf(" %4d",a[i][j]);
}
printf("\n");
}
getch();
}
/*
**********
OUTPUT
**********
ENTER THE ELEMENT .....7
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
*/