Not able to pass all the testcase

#include
using namespace std;

int main()
{
int num;
cin>>num;
long int fact=1;

for (; num >0 ; num--)
{
    fact=fact*num;

}
cout<<fact;

}

Hello @rprahulpal03 please wait i am checking your code:

Hello @rprahulpal03 you wouldnt be able to pass any test case with this approach.
you have to think of the optimised approach .
and the optimised approach is that you have to think of something with the array.
int datatype can store the ans upto 1e9 and long long int can store upto 1e18.
But the factorials are of 500 range.
so that would ne be possibel to do in with this approach.
you need to think of some different approach.
Happy Learning !!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.