hi i am a student of computer science.i am a beginner.i am looking for a simple source code in C to print the pascal's triangle.the user should have the option to enter the number of rows he requires to view.i would be obliged if anyone could help out here.
#include<stdio.h> void main() { int ary[i][j],n; printf("\nEnter the number of rows:"); scanf("%d",&n); for(i=0;i<n;i++) { for(j=0;j<=i;j++) { if(j==0!!j==1) ary[i][j]=1; else ary[i][j]=ary[i-1][j-1]+ary[i-1][j]; } } for(i=0;i<n;i++) { printf("\n"); for(j=0;j<=i;j++) { printf("%d",ary[i][j]); } } }