Given N and we have find the solution of series 1! + 2! + 3! + 4! + ... N! using Java program. (Sum of the factorials from 1 to N).
Example:
Input: 3
Output: 9
Explanation:
1! + 2! + 3! = 1 + 2 + 6 = 9
Input: 5
Output: 152
Explanation:
1! + 2! + 3! + 4! + 5!
= 1+2+6+24+120
= 153
Find sum of the factorials using java program
Output