In question fctrl2 it not accepting my answer, why?

#include
using namespace std;
int fact(int n){
int nfact=1;
for(int a=n; a>=1; a–)
nfact=nfact*a;
return nfact;
}
int main() {
int n;
cin>>n;
int no[n];
for(int a=0; a<n; a++)
cin>>no[a];
for(int b=0; b<n; b++)
cout<<fact(no[b])<<endl;
return 0;
}

what is wrong in it according to question?
Solution link
https://www.codechef.com/viewsolution/35361595

please give a link to your solution. BTW in fact function is that a-- or just a- ?

1 Like

Please see the constraints of the problem. n is 100. You cannot find 100 factorial normally like this. Either use strings or use inbuilt c++ boost hpp library