#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ // s = 1/1 + 1/2 + 1/3 + 1/4 +...+ 1/20 // 1/i s = s + (1/i) int main(int argc, char *argv[]) { float i; double s=0; i = 1.0; while(i<=20000) { s = s + (1/i); i++; } printf("S = %f",s); return 0; }