0
How to print pascal triangle perfectly using c
Pascal triangle
5 Réponses
+ 4
Here is the pascal triangle program in the easiest and perfect way possible
#include <stdio.h>
int main() {
// Program to print the pascal triangle
//Coded by Satya
int i,j,n,c,m;
printf("Enter the no of rows for pascal triangle \n");
scanf("%d",&n);
m=n-1;
for(i=1;i<=n;i++)
{
c=1;
for(j=1;j<=m;j++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("%d",c);
printf (" ");
c=c*(i-j)/j;
}
printf("\n");
m--;
}
}
0
I had tried but when double digit starts it is not going to look like a pattern.
I gets disfigured. So i want to know that if there is any way to remove this disfigureness.
0
https://code.sololearn.com/cG5zZEBaZhNH/?ref=app
0
My pattern is not correct but i think that my algorith is correct