help me below algorithm.
it gives wrong output
e2 was wrong. 7.38.....
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
float x, err, term_1,result=1.0;
int i=1,burcin;
float factorial;
cout << "x=";
cin >> x;
cout <<"error tolerance=";
cin >> err;
term_1=err+1;
while (term_1 > err)
{
factorial=1.0;
for (burcin=2;burcin <= i;++burcin)
factorial=factorial*burcin;
term_1=pow(x,i)/factorial;
result=result+term_1;
i++;
}
cout << "result is "<<result<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}