My output is correct still status showing wrong output

#include
using namespace std;

int fac(int n)
{

    if(n==0)
    {
        return 1;
    }
    else if(n==1)
    {
        return 1;
    }
    else
    {
        return n*fac(n-1);
    }

    

}

int main()
{
int number,x;
cin>>number;
for(int i=1;i<=number;i++)
{
cin>>x;
cout<<fac(x)<<endl;
}
return 0;
}

Contest Page | CodeChef (QUESTION)

Constraint is 1<=n<=100 , so you cannot store the factorials in variable of type int, use multiprecision int for c++ or use arrays to store the answer.

You can use python’s or Java’s big int to solve the problem
Or else refer this link

I believe, it must be due to the fact that long factorial values like 25! or 30! can’t be stored in “int data type” as it’s MAX_VALUE is pow(2, 31).
I suggest you to use “size_t (or) unsigned long long date type”, which has MAX_VALUE of pow(2, 64).
But anyway even it doesn’t allow you to use much more huge values like 100! or more.

I did it with python and got it correct but wanna do it with c++14

Yeah, you can use boost library to use big integers. refer this link

Thank you.