Pascal Triangle is a triangular array of the binomial coefficients in a triangle. It is shown in figure below.

This triangle can be constructed by adding 1 to first and last element of each row. Other elements can be calculated by adding the number above and to the left with the number above and to the right to find the new value.

Pascal Triangle can also be calculated with combination of two number. See here to find the Pascal triangle without use of array. This C program uses array to do the calculations. To implement this program you should know the knowledge of other basic program to implement.

## c code for pascal triangle

`/* c code for pascal triangle **/ #include<stdio.h> #include<conio.h> int main() { int a[10][10]; int no; printf("Enter the number of rows for pascal triangle : "); scanf("%d",&no); //taking input for(int i=1; i<=no; i++) { for(int j=1; j<=i; j++) { if(j==1||j==i) { a[i][j]=1; } else // taking arrays value { a[i][j]=a[i-1][i-j]+a[i-1][i-j+1]; } } } for(int i=1; i<=no; i++) { for(int k=1; k<=no-i; k++) { printf(" "); } for(int j=1; j<=i; j++) { printf("%d ",a[i][j]); //printing pascal triangle } printf("\n"); } getch(); }`

Output :

boht h theek h..yar maja a gaya ek dum faddooo..keep it up.. bye..stay best!!!!!