problem in small factorial

i have written this code for “small factorial” it is giving correct result in the compiler but the codechef judge is showing wrong answer:

#include<stdio.h>
int main (void)
{
  long int l3,n,l1,a=0,l2,p=0,b,c[200],temp=1;
  scanf("%ld",&n);
  for (l3=1;l3<=n;l3++)
  {
  a=0;p=0;temp=1;
  scanf ("%ld",&b);
  c[0]=1;
  for (l2=1;l2<=b;l2++)
  {
	a=0;
	for (l1=0;l1<=p;l1++)
	{
	 c[l1]=a+c[l1]*l2;
	 a=c[l1]/10;
	 c[l1]=c[l1]%10;
	}
	if(a>0)
	{
	 c[p+1]=a;
	 a=0;
	 p++;
	}
  }
  for (l1=p;l1>=0;l1--)
  printf("%ld",c[l1]);
  if (l3<n)
  printf("\n");

  }
	return 0;
 }

what could be the cause??

//