/* This is notation for comments in C and C++. I have two programs in this file, the first for summing 1/n and the second for summing x^n. */ #include /* Reference some standard C++ libraries. */ #include #include main () { int i; double sum=0; /* Initialize the sum to zero. */ for(i=1; i<1000; i++) { /* Take 1000 terms. */ sum += 1./i; /* Add 1/i to the running total. */ cout << i <<" "< #include #include main () { int i, flag; double sum=0, evalpt = 0.9, exactsum, cutoff; exactsum = 1./(1.-evalpt); /* geometric series formula */ cutoff = 0.01*exactsum; /* get within 1 percent */ for(i=0; i<1000; i++) { sum += pow(evalpt, i); if (exactsum - sum < cutoff) { cout << "i=" <