(+84) 236.3827111 ex. 402

Chương trình tìm số Pi theo công thức toán học cho trước


#include
#include
using namespace std;
#define epsilon 0.0001
int main()
{ float vp=0,pt,i=0;
do{ pt=pow(-1,i)/(2*i+1);
vp=vp+pt;
i++;
}while(fabs(pt)>=epsilon);
cout<<"\n So vong lap phai thuc hien tinh Pi: "<<>
cout<<"\n PI="<<4*vp;
}