#include
void main(){
int a[15][15],i,j,rows,num=25,k;
printf("\n enter the number of rows:");
scanf("%d",&rows);
for(i=0;i
printf(" ");
for(j=0;j<=i;j++){
if(j==0||i==j){
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();
}
No comments:
Post a Comment