Facebook
From Denim Pig, 2 Years ago, written in C.
This paste is a reply to Untitled from Botched Gorilla - view diff
Embed
Download Paste or View Raw
Hits: 172
  1. #include <stdio.h>
  2.  
  3. float piHesapla(int terim){
  4.         float sonuc=0;
  5.         int i;
  6.         float a=1;
  7.         for(i=0;i<terim/2;i++){
  8.                
  9.                 sonuc=sonuc+(4/a)-(4/(a+2));
  10.                 a=a+4;
  11.         }
  12.         return sonuc;
  13. }
  14.  
  15.  
  16.  
  17.  
  18. int main(){
  19.         int a=900;
  20.         float sonuc= piHesapla(a);
  21.         printf("%f",sonuc);
  22.         return 0;
  23. }