Example 27: Evaluate Exponential Series

Learn how to evaluate an exponential series.


The exponential function exe^{x} is defined as the sum of the following series:


If xx is an input to a function, write a program to calculate the sum of the first ten terms of the series.


Inputs Outputs
-4 0.096719
0 1.000000
1.5 4.481686
3 20.079666
5 146.380615

Try it yourself

Try to solve this question on your own in the code widget below. If you get stuck, you can always refer to the solution provided.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.