Question: Infinite series and Pi Approximation.

The value of Pi can be approximated by the infinite series 4-(4/3)+(4/5)-(4/7)+(4/9)-(4/11)+... . Write a procedure that takes as an input the integer n and uses a for-loop to return the decimal point approximation of using the nth partial sum of the infinite series. Determine the minimum value of n that gives the true value of to 5 decimal places.  


the 99 bottles of beer on the wall for loop is alot easier than this one. can some one walk me through it? i only have a general idea how to implement it.

Please Wait...