#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
double n = 1;
double sum = 0 ;
double previous = 0;
double y;
while(fabs(double (sum - previous)) > 0.001)
{
y = -1 (exp(double (n))) / n; **<<<Error is here<<<<**
sum += y;
previous = sum - y;
n++;
if (fabs(sum-previous) < 0.001)
{
cout << " The sum is =" << sum << "\n";
}
}
system("pause");
return 0;
}
The error is on line 13 im getting a 1>.\sum.cpp(13) : error C2064: term does not evaluate to a function taking 1 arguments i have no clue why is giving me that error plaease help me out with this one.....thanks in advance...