What is the mistake in this factorial program .codechef is not accepting this code.helpmeout

int main()
{
	int t,n,i,j,ans[1000],k=0;
	scanf("%d",&t);
	for(j=0;j<t;j++)
	{
		scanf("%d",&n);
		ans[k]=n;
		if(n==0)
		{
			ans[k]=1;
			k++;
			continue;
		}
		
		for(i=1;i<n;i++)
		{
			ans[k]=ans[k]*i;
		}	
		k++;
	}
	for(j=0;j<k;j++)
	{
		printf("%d\n",ans[j]);
	}
}```

first format the code [Tutorial] CoLoR format the Code!

ee case try chey

1
100

Your answer will overflow even when you compute a factorial of 50.
You have to compute the whole thing in a string. Check here to know how to do it.