Example of Menu driven modular program:
As an illustration of such a menu-driven program, we will write a program to discover the constant e.
The constant e, known as the natural exponential base, is used broadly in mathematics & engineering. There are many diverse applications of this constant. The value of the constant e is around 2.1718. Raising e to the power of x, or ex, is so general that this is known as the exponential function. In MATLAB, we have seen that, there is a function for above, exp.
The one way to determine the value of e is by finding a limit.
Since the value of n increases on the way to infinity, the outcome of this expression approaches the value of e.
The approximation for an exponential function can be found by using what is known as the Maclaurin series: