Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3.  
  4. using namespace std;
  5.  
  6. long double pi(int i)
  7. {
  8. if (i == 0)
  9. {
  10. return 1;
  11. }
  12. else
  13. {
  14. return -2/((4*i*i)-1);
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. cout << pi(2) << endl;
  21. system("pause");
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement