1 Replies - 2352 Views - Last Post: 01 October 2014 - 11:58 AM Rate Topic: -----

#1 arcadekid   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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   User is offline

  • palpable absurdity
  • member icon

Reputation: 6905
  • View blog
  • 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

Attached Image

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 :dontgetit:

This post has been edited by andrewsw: 01 October 2014 - 12:33 PM

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1