Home > database >  The approximate PI differ with the answer to 0.00001
The approximate PI differ with the answer to 0.00001

Time:10-19

#include
#include
Int main ()
{double eps, PI=0, term=1, I=1, n=1, m=1;
The scanf (" % le ", & amp; Eps);
While (fabs (term) & gt; Eps)=
{PI=PI + term;
M *=I;
=n * (2 * I + 1);
The term=m/n;
i++;
}
PI PI *=2;
Printf (" % 5 f ", PI);
return 0;
}



Code to run results of 3.14157
The answer is 3.14158
How to do, big help!

CodePudding user response:

With what kind of series?

CodePudding user response:

The end of this cycle condition is problematic
  • Related