New course! Every coder should learn Generative AI!
Try a free lesson0
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double t,p,invp,k,pi,n,a,fctn=1,b,fct4n=1 ;
for (n=1,k=1;n<21;n++)
{
for (a=1;a<n+1;a++)
{
fctn=fctn*a ;
} ;
for (b=1;b<4*n+1;b++)
{
fct4n=fct4n*b ;
} ;
t = pow(396 ,4*n)*pow(fctn ,4*n) ;
p = pow(8 ,0.5) ;
k=fct4n*(26390.0*n+1103.0)/(t)+k ;
}
invp=k*(p)*1103.0/(9801) ;
pi=1/invp ;
cout << pi ;
return 0;
} // the program.....plz help!!!!