Question
*6.13 ( Estimate ) can be computed using the following summation: m ( i )=4(1(1/3)+(1/5)(1/7)+(1/9)(1/11)++((1)^( i +1))/2 i 1) Write a function that returns m(i)
*6.13 (Estimate ) can be computed using the following summation:
m(i)=4(1(1/3)+(1/5)(1/7)+(1/9)(1/11)++((1)^(i+1))/2i1)
Write a function that returns m(i) for a given i and write a test program that displays the following table:
My program runs into an error when I input my value of i:
#include
using namespace std;
int main() { double pi(double i), i = 0; int count = 0, j = 1; double mi = 0;
cout > i;
for (double den = 1; den
else { mi = mi - (1 / den); count = 0; } double r = pow(10.0, -ceil(log10(fabs(mi*4.0000)))); return (round((mi*4.0000)*r) / r); } for (double j = 1; j
Sample Run for Exercise06_13 command>Exercisee6 13 181 281 301 401 501 601 701 801 901 4.800 3.1515 3.1466 3.1449 3.1441 3.1436 3.1433 3.143e 3.1428 3.1427 command>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started