#include <stdio.h> #include <math.h> int main () { int sign=1; double pi=0.0,term=0.0,n=1.0; while(1) { if (sign/(n*n)<=1e-6) break; term=term+sign/(n*n); n++; pi=sqrt(6*term); } printf("%.2f\n",pi); return 0; }