|
|
exp() - Mathematical Function
|
Tutorials

Cpp

|
Topic |
How is Mathematical Function "exp()" used in C++?
How to find the Exponential value of an argument using c++?
|
|
Explanation |
|
exp() is a Mathematical Function that returns the natural logarithm base "e" raised to the
arguments power.
Syntax to find Exponential Value:
float exp( float num);
double exp( double num);
long double exp( long double num);
Example:
#include <iostream.h>
#include <cmath.h>
int main()
{
cout << "The Exponential Value of 2 is:: "
<< exp(2) << endl;
return 0;
}
|
Result:
The Exponential Value of 2 is:: 7.38906
In the above example exp() is used to find the Exponential Value of "2".
|
| Note |
C++ is one of the most used programming languages in the world. Also known as "C with Classes".
Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.
|
|
|
|