include //needed for cin and cout #include //needed for using the exp function using namespace std;

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

include //needed for cin and cout #include //needed for using the exp function using namespace std;

Post by answerhappygod »

Include Iostream Needed For Cin And Cout Include Math H Needed For Using The Exp Function Using Namespace Std 1
Include Iostream Needed For Cin And Cout Include Math H Needed For Using The Exp Function Using Namespace Std 1 (65.64 KiB) Viewed 52 times
include <iostream> //needed for cin and cout #include <math.h> //needed for using the exp function using namespace std; long long int factorial(int ) { if (k -- ) return 1; > return factorial(k. 1) K3 } e int main() { cout << "Please enter x: double x; cin >> X; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 cout << "Please enter N: "; int N; cin >> N; // Write here the code to compute the approximate ex using 1+1 terms of the power series. // Store the result in a variable called "approx" (used in the cout statement below) // Test your solution for different values of x and N: The approximation should converge to the exact value as N becomes large cout <<endl<< "The approximate value of e'x using " << N+1« terms of the power series is: « approx<<endl; cout << "The exact value of e'x is: " << exp(x) << endl; //here we used the exp function from the math.h library to get the exact value of ex return; }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply