Given two number m and n, the task is to find factorial of all number including m and n and then print below format.
Input : 6 10 Output : 720 5040 40320 362880 3628800 Input : 10 20 Output : 3628800 39916800 479001600 6227020800 87178291200 1307674368000 20922789888000 355687428096000 6402373705728000 121645100408832000 2432902008176640000
We used the boost multiprecision library for store the factorial of large number and print the factorial with the setw() function.
setw(int) -> setw(int) is a function is used for intention in the result.
3628800 39916800 479001600 6227020800 87178291200 1307674368000 20922789888000 355687428096000 6402373705728000 121645100408832000 2432902008176640000
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.
- Count natural numbers whose factorials are divisible by x but not y
- Numbers whose factorials end with n zeros
- Calculating Factorials using Stirling Approximation
- Trailing number of 0s in product of two factorials
- Queries for the product of first N factorials
- GCD of factorials of two numbers
- Product of first N factorials
- Find the unit place digit of sum of N factorials
- Find last two digits of sum of N factorials
- Check if a given number divides the sum of the factorials of its digits
- Find sum of factorials in an array
- Minimum number of Factorials whose sum is equal to N
- Sum of factorials of Prime numbers in a Linked list
- Fast method to calculate inverse square root of a floating point number in IEEE 754 format
- Represent the fraction of two numbers in the string format
- Convert Unix timestamp to DD/MM/YYYY HH:MM:SS format
- Maximum time in HH:MM:SS format that can be represented by given six digits
- Number of ways to obtain each numbers in range [1, b+c] by adding any two numbers in range [a, b] and [b, c]
- Generate a pair of integers from a range [L, R] whose LCM also lies within the range
- Segmented Sieve (Print Primes in a Range)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.
Improved By : Mithun Kumar