The value of π can be determined by the series equation
π=4∗(1-1/3+1/5−1/7+1/9−1/11+1/13…)
Write a program that prompts the user to enter a positive odd number n and uses recursion to approximate the value of π using the given formula including term up through 1/n.
Solution:
π=4∗(1-1/3+1/5−1/7+1/9−1/11+1/13…)
Write a program that prompts the user to enter a positive odd number n and uses recursion to approximate the value of π using the given formula including term up through 1/n.
Solution: