C languageC SolutionChapter 4Programming

Q21 The natural logarithm can be approximated by the following series. If x is input through the keyboard, write a program to calculate the sum of first seven terms of this series.

Program:115

The natural logarithm can be approximated by the following series.

\frac{x-1}{x}+\frac{1}{2}\left ( \frac{x-1}{x} \right )^{2}+\frac{1}{2}\left ( \frac{x-1}{x} \right )^{3}+\frac{1}{2}\left ( \frac{x-1}{x} \right )^{4}+.....

If x is input through the keyboard, write a c program to calculate the sum of first seven terms of this series.

Output:

Enter the value of x: 5
Result: 1.980570

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.