Help me in solving FCTRL2 problem

My issue

i dont know what is wrong the output comes same as expected still its showing wrong answer please help.

My code



#include<stdio.h>

void factorial(int num){
    long long fact=1;
    for (long long i=1;i<=num;i++){
        fact*=i;
        }
    printf("%lld \n",fact);
}
int main()
{ 
    int t,n;
    scanf("%d",&t);
    
    for (int i=0;i<t;i++){
        scanf("%d",&n);
        factorial(n);
    }
    return 0;
}




Problem Link: Small factorials Practice Coding Problem - CodeChef

@dhruvgoraidev
u have to do it like this for higher values of n

//We have populated the solutions for the 10 easiest problems for your support.
//Click on the SUBMIT button to make a submission to this problem.

#include<stdio.h>

int main()
{
    int t,n,a[200],i,j,k,l,m;
    scanf("%d",&t);
    while(t--)
    {
	    scanf("%d",&n);
        m=1;
        a[0]=1;
        for(j=2;j<=n;j++)
        {
            l=0;
            for(k=0;k<m;k++)
            {
                a[k]=a[k]*j+l;
                l=a[k]/10;
                a[k]=a[k]%10;
            }
            while(l)
            {
	            a[k]=l%10;
                k++;
                m++;
                l=l/10;
            }
        }
        for(i=m-1;i>=0;i--)
            printf("%d",a[i]);

        printf("\n");
    }
    return 0;
}