#include

using namespace std;

```
int main()
{int t;
int n;
cin>>t;
for(int i=0;i<t;i++)
{cin>>n;
int prod=1;
for(int j=1;j<=n;j++)
{prod=prod*j;
}
cout<<prod<<endl;
}
}
```

#include

using namespace std;

```
int main()
{int t;
int n;
cin>>t;
for(int i=0;i<t;i++)
{cin>>n;
int prod=1;
for(int j=1;j<=n;j++)
{prod=prod*j;
}
cout<<prod<<endl;
}
}
```

You must use long long int to store numbers upto 20 factorial as they are large. For numbers larger than 20!, you cannot store in conventional data type and either should switch to python or read about implementing big integer library in C/c++.