#include "stdio.h" void main() { float a=2,b=1; double num=1; int i; for (i=1;i<=100;i++) { num*=a/b; if(i%2==0) a+=2; else b+=2; } num*=2; printf("π=%.16lf\n",num); }
5201314