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?

Your builder path starts here. Builders don't just know how to code, they create solutions that matter.

Escape tutorial hell and ship real projects.

Try Programiz PRO
  • Real-World Projects
  • On-Demand Learning
  • AI Mentor
  • Builder Community