- 3

Write a C++ code that computes the sum of the following series

Sum=1!+2!+3!+---+n!

1st Dec 2021, 5:55 PM
Eyasu Esatu
Eyasu Esatu - avatar
6 Answers
1st Dec 2021, 7:30 PM
Simon Sauter
Simon Sauter - avatar
0
https://code.sololearn.com/c4YBYzQr8Etr/?ref=app
1st Dec 2021, 6:18 PM
Shashank Shekhar
Shashank Shekhar - avatar
0
Sum = 0; For(I=1;I<=n;I++) { Product = product *I; Sum = sum + product; } This can hold good till some extent. But if value of n is large than u have to adjust product and sum here by giving perfect data type. 2nd approach will be use concept of dynamic programming.
1st Dec 2021, 6:30 PM
Pranshu Sachan
0
What's the DP approach to solve it?
1st Dec 2021, 6:32 PM
Shashank Shekhar
Shashank Shekhar - avatar
- 3
Write a C++ program that will print the following shape + +++ +++++ +++++++ +++++++++
1st Dec 2021, 6:24 PM
Eyasu Esatu
Eyasu Esatu - avatar
- 3
Write for do-while and while statement to compute the following sum 1+1/2+1/3+1/4+1/5+1/6+1/7+1/8+1/9+1/10+1/11+1/12+1/13+1/14+1/15
1st Dec 2021, 6:38 PM
Eyasu Esatu
Eyasu Esatu - avatar