Small Factorial, I tested my solution against WOLFRAM ALPHA but still wrong answer!!

http://www.codechef.com/viewsolution/6569544

here is my solution.
I’ve checked as many possible cases I can but no use, still WA.

#include<stdio.h>
#include<stdlib.h>
#define MAX 500
//////////////////////////////////////////////
int multiply(int *k,int num,int size)
{

int carry=0,i,j,n;
for(i=0;i<size;i++)
{
j=k*;
k*=((jnum)+carry)%10;
carry=((num
j)+carry)/10;

}

n=carry;
while(carry/10!=0)
{
k*=carry%10;
carry=carry/10;
i++;
}
k*=carry;
++i;

return i;
}

/////////////////////////////////////////////////
int fill(int k,int num)
{
if(num/10==0)
{k[0]=num;return 1;}
else if(num==100)
{k[0]=0;k[1]=0;k[2]=1;return 3;}
else
{k[0]=num%10;k[1]=num/10;return 2;}
}
//////////////////////////////////////////////////
void display(int k,int size)
{
//printf("
");
//printf(“Display
“);
int j;
for(j=size-1;j>=0;j–)
{
printf(”%d”,k[j]);
}
}
/////////////////////////////////////////////////
void fact(int n,int fac)
{
//printf("Fact
");
int i,j,num,k,temp,adder,size,foo;
num=n;
if(n%2==0)
{j=num/2;foo=0;}
else
{j=num/2+1;foo=1;}
k=(int )calloc(j,sizeof(int));
temp=0;adder=num;
if(foo==0)
{
for(i=0;i<j;i++)
{
k
=num+temp;
adder=adder-2;
temp=adder;
num=k
;
}
}
else
{
for(i=0;i<j-1;i++)
{
k
=num+temp;
adder=adder-2;
temp=adder;
num=k
;
}
k
=j;
}

size=fill(&fac[0],k[0]);

for(i=1;i<j;i++)
size=multiply(&fac[0],k*,size);
display(&fac[0],size);
}

int main()
{

int *k,i,j,n,num,t;

int fac[MAX];

scanf("%d",&t);

for(i=0;i<t;i++)
{
scanf("%d",&n);
if(n==0){printf("%d
“,1);continue;}
fact(n,&fac[0]);
printf(”
");
}
return 0;
}

It is giving the right answer for all the numbers between 1->100, also i’ve put 0!=1.
Plzz help i’ve been on it for 12 hrs now…

this is my code .