# Approximating the value of pi using the Leibniz series

Page 1 of 1

## 1 Replies - 2352 Views - Last Post: 01 October 2014 - 11:58 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=354896&amp;s=3c16a961bb122c5d60528beeefe59332&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

Reputation: 0
• Posts: 1
• Joined: 01-October 14

# 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

• palpable absurdity

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