Question: PI = 4 ( 1 1 / 3 + 1 / 5 1 / 7 + 1 / 9 1 / 1 1 + .

PI =4(11/3+1/51/7+1/91/11+...)
Write a program called ApproximatePi.javaApproximatePi.java that
takes in a an integer
N as a command line argument, approximates pi using the first
N terms of the summation above, and prints the result.
[[going back and forth to adding and subtraction every loop]] USE LOOP PLEASE
PI = 4 ( 1 1 / 3 + 1 / 5 1 / 7 + 1 / 9 1 / 1 1 +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!