Example 27: Evaluate Exponential Series
Learn how to evaluate an exponential series.
We'll cover the following
Problem
The exponential function is defined as the sum of the following series:
If is an input to a function, write a program to calculate the sum of the first ten terms of the series.
Example
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 80+ hands-on prep courses.