Page 1 of 1

# Approximating the value of pi using the Leibniz series

Posted 01 October 2014 - 11:43 AM

The question is :

Write a program that approximates the value of π using the Leibniz series and compares
the Leibniz series approximation against the known value of π and two other common
approximations of π (22/7 and 355/113). The program must prompt the user for the desired
number of terms (n) to use in the approximation (as an integer) and calculate the approximate
value of π to the given number of terms. The program must display each approximation of π and
display the difference between each approximation.

I understand how to prompt for the number, what I don't even get how to start is to use it to approximate the value of pie in that given number. Also how to tell the difference between each approximation

Is This A Good Question/Topic? 0

## Replies To: Approximating the value of pi using the Leibniz series

### #2 andrewsw Reputation: 6905
• Posts: 28,565
• Joined: 12-December 12

## Re: Approximating the value of pi using the Leibniz series

Posted 01 October 2014 - 11:58 AM

You get the value of n and plug it into the series wikipedia

Quote

Also how to tell the difference between each approximation

..subtract them.

Quote

what I don't even get how to start is to use it to approximate the value of pie in that given number.

That's what Leibniz formula does, so this statement puzzles me This post has been edited by andrewsw: 01 October 2014 - 12:33 PM

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }