ok i have 2 series of p...
the user give which one was want...
and then give the iterations that he/she want
this is the series
4. P= sqrt(8*(1+ (1/9)+(1/25)+(1/49)+... ))
5. P= sqrt(24*((1/4)+(1/16)+(1/36)+(1/64)+...))
code::
first for series 4.....
int i;
double: serieValue=0,pi=0;
cout<<"Iterations";
cin>>i;
for (long int n = 1; n <= i; n++)
{
serieValue+= pow(+1.0, n+1)/pow(n*n,2.0);
}
pi=sqrt(8*serieValue);
cout << "Estimated PI value "<< pi<<endl;
code:::
for series 5.....
int i;
cout<<"Iterations: ";
cin>>i;
double: serieValue=0,pi=0;
for (long int n = 1; n <= i; n++)
{
serieValue+= pow(+1.0, n+1)/pow(n*n+2,2.0);
}
pi=sqrt(24*serieValue);
cout << "Estimated PI value "<< pi<<endl;
But isn't works....Please any ideas to fixed it this problem???
Thank you very much