#include<stdio.h>
int main(void)
{
int x[20000],i=0,j=0,k=1,y=0,t=1,n=0,l=0,carry=0;
while(k){
printf("\nenter the value ");
scanf("%d",&n);
x[0]=1;t=1;
for(i=2;i<=n;i++)
{l=i;
for(j=0;j<t;j++)
{y=x[j]*l+carry;
x[j]=y%10;
carry=y/10;
}
while(carry>0)
{x[t]=carry%10;
carry=carry/10;
t++;
}
}
for(i=t-1;i>-1;i--)
printf("%d",x[i]);
printf("\n");
printf("enter 0 to exit, any other integer to continue.. ");
scanf("%d",&k);
}
}
On Aug 12, 11:00 pm, Leopoldo Taravilse <[email protected]> wrote:
> 0! is not 0, it's 1
--
You received this message because you are subscribed to the Google Groups
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.