Original Code Homework 3 Modified Problem 2 Include Include Using Namespace Std Function D Q37073936

Problem - 2: Consider Problem 1 in HW-3 that calculates the value of the series e, sin z, cos r using functions. Now modify t

The original code for “Homework 3” that has to be modified inProblem 2:

#include <iostream>

#include <cmath>

using namespace std;

// Function Declarations

double my_exp(double x, int n);

double my_sin(double x, int n);

double my_cos(double x, int n);

long int factorial(int x);

int main(){

double val;

cout << “Value at which to calculate exp, sin, andcos:” << endl;

cin >> val;

for(int i=1; i<=20; i++){

cout << “exp(” << val << “, ” <<i << “) = ” << my_exp(val, i) <<

endl;

}

cout << “**************” <<endl;

for(int i=1;

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.