Practice
ln 2
Write a program that calculates the approximate value of the
natural logarithm of 2.
The natural logarithm of 2 is calculated using the infinite series
ln 2 = 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + 1/7 - ...
|
Your program prompts for and accepts the number of terms to
be used in calculating the approximation.
Your program displays the approximate value to 6 decimal places.
|