Write a c++programme to find sun of n series =1+(2/3!)+(3/5!)+(4/7!)......+.... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Write a c++programme to find sun of n series =1+(2/3!)+(3/5!)+(4/7!)......+....

c++

26th Feb 2018, 2:59 PM
ANEX
2 Answers
+ 15
it will be a simple 1-liner //use maths , take reference from my code & derive general formula for sum //my old code , when i started with java ☺👍 https://code.sololearn.com/cDMkrs0n9cM6/?ref=app
26th Feb 2018, 4:27 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 1
1/1! + 2/3! + 3/5! ... n/(2n-1)! ∞ <=> ∑ n/(2n-1)! =~1,36 (-> e/2 ? idk... ^^) n=1 Anyways... you need a while loop which exits when the difference between the last and current result is smaller than a certain (small) value. That would end with an approximation of the sum of this sequence.
26th Feb 2018, 3:25 PM
Alex
Alex - avatar