More C++ Worries.
Can anyone help me with this extra credit problem?
e^x= 1 +(x/1) + (x^2/2) + (x^3/6) = (x^4/24)...X^n/n!
I have to read in x from the keyboard and use the exponential function on x and write the result.
Then do the approximation for the first four terms, starting at 1 and write the results.
Then write the difference between the two.
Well... What's n?
You could just use a loop - i think that'd be the easiest way... Have you made any headway on this since yesterday?
n is just the number of what power we raised it to. For example X^2/2!.
I know I need the following libraries
I am so glade you are there because this is due in a couple of hourse and I am TOTALLY stressed out!!!;)
Well, to do this...
To multiply a number and an exponent you just do this:
int number1 = 2;
int number2 = 3;
int result = 0;
result = number1 * exp(number2); // exp(...) is for exponent
cout << result;