exp() - Mathematical Function

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".

C++ Tutorial


Ask Questions

Ask Question