You can use the C++ library <boost/multiprecision/cpp_int.hpp>
for such problems.
For example:
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;
using namespace std;
int main()
{
cpp_int f = 1;
for(int i = 1; i <= 100; i++)
f *= i;
cout << "100! = " << f << '\n';
}
This will give the output
100! = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
To know more about C++ boost library, you can refer here and here