fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double p = 1.0, s = 0.0;
  5. for (int i = 1; i <= 262141; i += 2) {
  6. s += p / i;
  7. p = -p;
  8. }
  9. printf("%f\n", 4 * s);
  10. return 0;
  11. }
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
3.141600