Encountered an issue with the Small factorial program

I am facing an issue with this program of small factorial even though my code is right but still, it is not accepting my code. Does anyone know what is the problem with my code? :sweat_smile:

Here is the code:


int main()
    int num;
    scanf("%d", &num);
    for(int i = 0; i < num; i++)
    {   int a,fact = 1;
        scanf("%d", &a);
        while( a > 0)
            fact *= a;
    return 0;

An integer t, 1<=t<=100, denoting the number of test cases, followed by t lines, each containing a single integer n, 1<=n<=100.

As you can see, n can go up to 100.
And 100! is this big.


The maximum value you can fit in an Integer is 2147483647.
This link provides you with information about limits in C and CPP.

You might want to use arrays, or big integers (available in specific languages) to solve this problem.


So, is this program only possible with arrays if we want put limit on integers ?
Thanks, geek :innocent: