- 3
Write a C++ code that computes the sum of the following series
Sum=1!+2!+3!+---+n!
6 Respuestas
+ 1
Please take a look at the forum rules:
https://www.sololearn.com/Content-Creation-Guidelines/
https://www.sololearn.com/Discuss/1316935/?ref=app
Take a look at these guides on how to ask a question.
https://stackoverflow.com/help/how-to-ask
https://www.sololearn.com/blog/38/8-simple-rules-to-get-help-from-the-community
Please always tag the language you're asking about.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
0
https://code.sololearn.com/c4YBYzQr8Etr/?ref=app
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.
0
What's the DP approach to solve it?
- 3
Write a C++ program that will print the following shape
+
+++
+++++
+++++++
+++++++++
- 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