C++ Program to print following series : x + x^3/3! + x^5/5! +.......+ x^n/n!
What have you tried so far and where are you stuck?
No....Idea...
Only Thing i knw is to Find the Sum of X + x^2 + x^3 .......x^n...
i knw to find the Factorial of a given.....number....but idk to implement accoring to power like x^3/3! x^4/4!
use the exp function <cmath>
in python - looks about the same in c: def sinh(x): { a = x sum = a n = 2 while a > .1: { a = a * x**2 / (n * (n + 1)) sum += a n = n + 2 } return sum }
You could create a recursive function to print the values out for you. As for how to do powers, it really depends on how far you have come in the lesson. If you are following a curriculum then you are most likely just supposed to do x*x*x for x^3, if you are not following any lesson plan then you can probably use the exp() function as was suggested earlier. http://www.cplusplus.com/reference/clibrary/cmath/exp/
Join our real-time social learning platform and learn together with your friends!