Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. The number is a mathematical constant approximated at 3.14. A formula for computing it is as follows: Write a program called pic that approximates

image text in transcribed
1. The number is a mathematical constant approximated at 3.14. A formula for computing it is as follows: Write a program called pic that approximates the value of by using the following equation: where n is a number entered by the user Your program will first compute as 4( (-1)Y1) then as 4( (-1)/1 + (-1)'/3), then as 4( (-1)/1 + (-1)/3 + (-1)/5) and so on. In each step, print the step number and the value of so far, as follows (with 8 digits after the decimal point): 0: 1: 2: 3.46666666 Use double (not float) to store the value of pi. Update your program so the output is printed every 100 iteration. How many iterations (up to precision in 100's) does you program take for the value to pi to converge within 10*ero(.e, to stop changing the estimated value even if you increase the given output n)? Only when you are ready, use typescript from the script command to report the computer session that computes at the required precision 10.. Note: using math.h, you need to link the math library when compiling your program using the gcc option-lm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Science For Dummies

Authors: Lillian Pierson ,Jake Porway

2nd Edition

1119327636, 978-1119327639

More Books

Students also viewed these Databases questions

Question

explain the concept of strategy formulation

Answered: 1 week ago