the program goes like this:
it should calculate the value of e^x by the series
when the user inputs a value , eps , which the program has to stop compute e^x when x^n/n<eps.
I wrote 2 function , one calculating the factorial result (fact), and one calculates the value x^n/n! (monom).
these functions works well, but the program keeps giving me 1 as result for e^x (or it gets stuck..)
it seems that the problem comes from the condition monom (x,j)<eps, but I can't see why...
can you guys help me? thanks a lot!
float fact (int);
double monom (float x, int n);
int main (void)
printf ("please enter x value for e^x: ");
scanf ("%f", &x);
printf ("please enter delta: ");
scanf ("%f", &eps);
for (j=1; monom (x,j)<eps; j++)
float fact (int a)
double monom (float x, int n)