Hello everyone, there were difficulties in solving the problem: when entering the value of "ε", the program does nothing. I can not understand where the mistake was made. Please help me fix it. And do I solve it correctly?
The task is as follows: Calculate the infinite sum of a given precision ε (ε> 0). Consider that the required accuracy is reached if the next addend turned out to be less than ε in absolute value.
Directly my "decision"
#include "stdafx.h" #include <iostream> #include "cmath" using namespace std; int main() { double i, z; float s, e, t; cout << "e>0 e="; cin >> e; s = 0; i = 0; z = -1; do { i++; z *= -1; t = z / (i*(i + 1)*(i + 2)); s += t; } while (abs(t)<e); cout << s << endl; system("pause"); return 0; } 
Cчитать что требуeмая тoчнoсть дocтигнутa,если очередное слагаемое оказалось по модулю меньше ε.Yeah and the amount of1/ncan be calculated ... - pavel