small factorial ,wrong answer?can anyone point out the error?

#include<stdio.h>

void copy(int*str1,int*str2)
{
  int i;
  for(i=0;i<=str1[0];i++)
  {
	str2[i]=str1[i];
  }
}



void shift(int*str)
{
	str[0]+=1;
	str[str[0]]=0;

}


void mul(int*str,int x)
{
	int len=str[0],i,tlen=0,c=0;
	int temp[200];

	while(len)
	{
		temp[tlen]=(c+(str[len]*x))%10;

		c=(c+(str[len]*x))/10;
		len--;
		tlen++;

	}

	if(c!=0)
	{
	   temp[tlen]=c;
	   tlen++;
	}

	str[0]=tlen;

	for(i=0;i<tlen;i++)
	{
		str[tlen-i]=temp[i];
	}

}


void merge(int*str1,int*str2)
{
	int str3[200];
	int len1,len2,len3,c,i;

	len1=str1[0];
	len2=str2[0];
	len3=0;
	c=0;

	while(len1>0&&len2>0)
	{
		str3[len3]=(c+str1[len1]+str2[len2])%10;
		c=(c+str1[len1]+str2[len2])/10;

		len1--;
		len2--;
		len3++;
	}


	while(len1>0)
	{
		str3[len3]=(c+str1[len1])%10;
		c=(c+str1[len1])/10;

		len1--;
		len3++;
	}


	while(len2>0)
	{
		str3[len3]=(c+str2[len2])%10;
		c=(c+str2[len2])/10;


		len2--;
		len3++;
	}

	if(c!=0)
	{
		str3[len3]=c;
		len3++;
	}

	str1[0]=len3;

	for(i=0;i<len3;i++)
	{
		str1[len3-i]=str3[i];
	}



}



int main()
{
	int test,x,i;

	int m_str[200],t_str[200];

	scanf("%d",&test);

	if(test>0&&test<=100 )
	{
	while(test--)
	{

		scanf("%d",&x);

		if(x>0&&x<=100)
		{

		m_str[0]=1;
		m_str[1]=1;


		while(x>2)
		{
			if(x<10)
			{
				mul(m_str,x);
			}
			else
			{
				copy(m_str,t_str);

				mul(m_str,x%10);

				mul(t_str,x/10);
				shift(t_str);

				merge(m_str,t_str);

			}

			x-=1;
		}


		mul(m_str,x);

		for(i=1;i<=m_str[0];i++)
			printf("%d",m_str[i]);
		}

	}

	}


	return 0;

}

You missed this in statement: “For each integer n given at input, display a line with the value of n!”. Read also section How should I test my program from FAQ :wink:

//