Please help with the task, here is the condition Find the sum of a row with an accuracy to a member of a row smaller than 0.0001 for a given value and compare this sum with the control function. To calculate the next value of a series member, use a recurrent formula. http://stuffed.ru/images/100197-latex.html value x: -1 <x <1 Control function: arctg x
#include <iostream> #include <math.h> using namespace std; int main () { double x,stx,sint,e; int i,fakt,z; cout << "vvedi x " << endl; cin>>x; cout << "vvedi e " << endl; cin>>e; stx= x; fakt= 1; sint= 0; i= 1; z= 1; while (stx/fakt>=e) { sint=sint+z*stx/fakt; i=i+2; stx=stx*x*x; fakt=fakt*(i-1)*i; z=z*(-1); } double g = sin((double)(x)); cout <<"SIN: "<< g << endl; cout <<"SINT"<< sint << endl; if ( g==sint) {cout<<"ravni";} else {cout<<"ne ravni";} return 0; }