Program 79: What is Pascal's Triangle?
//Coming Soon...
Output:
#include<stdio.h>
#include<math.h>
main()
{
int i,j,k,rows,count;
long x;
printf("Enter number of rows\n");
scanf("%d",&rows);
count=rows-1;
for(i=0;i<rows;i++)
{
x=1;
for(k=0;k<=count;k++)
{
printf(" ");
}
for(j=0;j<=i;j++)
{
printf("%6ld",x);
x=(x*(i-j)/(j+1));
}
count--;
printf("\n");
}
}
Explanation://Coming Soon...
Output:



