Hi to all
I need help with this program, i have problem, i must write it out from left to right not from right to left, but i do not know how to do it, when i change something in program, than it is not working :(
here is the program, i am writing it in visual studio 2005
#include<stdio.h>
void pasc(int n)
{
int r;
long fact(int);
for(r=0;r<=n;r++)
printf("%3ld",fact(n)/(fact(n-r)*fact(r)));
}
long fact(int v)
{
if(v==1||v==0)
return(1);
else
return(v*fact(v-1));
}
int main()
{
int l,i,n,j;
void pasc(int);
printf("\n\nUnesite broj redaka: ");
scanf("%d",&l);
printf("\n");
printf("\nPascalov trokut :\n");
for(j=l-1;j>=0;j--)
printf(" ");
printf(" 1\n");
for(n=2;n<=l;n++)
{
for(i=l-n;i>=1;i--)
printf(" ");
pasc(n);
printf("\n");
}
}