Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- using namespace std;
- int main(void)
- {long double pi=1,si,i;
- for(i=1;i<100000;i++)
- {si = (pow(-1.0 ,i))/(2*i+1);
- pi += si;
- }
- pi*=4.0;
- cout<<" "<< pi <<" n ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement