The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Â
Â
Show transcribed image text (100 pts) Write a program that implements the following functions. long factorial(int n) double exponent(double x, int n) The functions implemented should follow below guidelines Factorial: Computes n! = n x (n - 1) x ? x 1 Exponent: Computes the sum of first n terms of e^x using the following approximation. f(x, y) = e^x = Read the value of n and x from the user and compute the first n terms of e^x using the function exponent. Print the result returned by the function and compare it with the value obtained by calling the math library function exp. When you increase the value of n your result should get closer to the result of exp. Sample execution of the program is given below Enter n and x 20 2.1 Approximation = 8.1753222282 Exact = 8.1661699126
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll