#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