# Factorial of Large Number Using boost multiprecision Library

We have given a large number now we can easily find out the factorial of this large number using boost multiprevision Library.
Boost library has included a new multiprecision library in the current 1.53.0 release for C++ programmers who need more precision than 64 bits.

Examples:

```Input : 100
Output :  933262154439441526816992388562667004-
907159682643816214685929638952175999-
932299156089414639761565182862536979-
208272237582511852109168640000000000-
00000000000000

Input :50
Output : 3041409320171337804361260816606476884-
4377641568960512000000000000
```

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

 `// CPP program to find factorial of large  ` `// number using boost library. ` `#include ` `#include ` `using` `boost::multiprecision::cpp_int; ` `using` `namespace` `std; ` ` `  `cpp_int Factorial(``int` `number) ` `{ ` `    ``cpp_int num = 1; ` `    ``for` `(``int` `i = 1; i <= number; i++) ` `        ``num = num * i; ` `    ``return` `num; ` `} ` ` `  `int` `main() ` `{ ` `    ``int` `number = 100; ` `    ``cpp_int fact = Factorial(number); ` `    ``cout << fact << endl; ` `    ``return` `0; ` `} `

Output:-

```933262154439441526816992388562667004-
907159682643816214685929638952175999-
932299156089414639761565182862536979-
208272237582511852109168640000000000-
00000000000000```

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

20

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.