Question: IN C++ Write a program that calculates pi using the Nilakantha Series. The program should accept a threshold from standard in indicating how close to
IN C++
Write a program that calculates pi using the Nilakantha Series. The program should accept a threshold from standard in indicating how close to pi one should calculate. The program should output for each term in the series: the result of the calculation of pi so far (fixed notation and 6 significant figures) and the different between the aproximation and actual pi (scientific notation and 2 significant figures). Once the difference is less than the threshold, cease the program.

INPUT OF THE TEST CASE 1 0.0025 YOUR CODE'S OUTPUT did not compile/run! --- - THE CORRECT OUTPUT OF THE TEST CASE 1 2 3.000000 1.42e-01 3.166667 2.51e-02 3.133333 8.26e-03 3.145238 3.65e-03, 3.139683 1.91e-03, 4 5 PRETTY DIFF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
