#include<stdio.h> int main() { double b,c,n; c=0.0; n=1.0; b=1.0/(2*n-1); do { c+=b; n++; b=1.0/(2*n-1); }while(n<=50); printf("%lf",c); return 0; }
#include <stdio.h> int main( void ) { double sum = 0.0; for( int i=99; i>0; i-=2 ) sum += 1.0/i; printf( "%f\n", sum ); return 0; }