C exp()

C exp() Prototype

The function prototype of exp() is:

double exp(double x);

The ex in mathematics is equal to exp(x) in C programming.


exp() Parameters

The exp() takes a single argument.

  • x - a double value.

exp() Return Value

The exp() function returns a double value.


The exp() function is defined in the <math.h> header file.


Example: C exp() function

#include <math.h>
#include <stdio.h>

int main() {
  double x = 12.0, result;
  result = exp(x);
  printf("Exponential of %.2lf = %.2lf", x, result);
  return 0;
}

Output

Enter the value of x to find e^x: 12
Exponential of 12.00 = 162754.79
Did you find this article helpful?

Our premium learning platform, created with over a decade of experience and thousands of feedbacks.

Learn and improve your coding skills like never before.

Try Programiz PRO
  • Interactive Courses
  • Certificates
  • AI Help
  • 2000+ Challenges