fork download
  1. #include <boost/multiprecision/cpp_int.hpp>
  2. using namespace boost::multiprecision;
  3. using namespace std;
  4.  
  5. cpp_int boost_factorial(int num)
  6. {
  7. cpp_int fact = 1;
  8. for (int i=num; i>1; --i)
  9. fact *= i;
  10. return fact;
  11. }
  12.  
  13. int main()
  14. {
  15. int num=100;
  16. cout << "Factorial of " << num << " = "
  17. << boost_factorial(num) ;
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 4384KB
stdin
Standard input is empty
stdout
Factorial of 100 = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000