Popular Tutorials
Start Learning CCertification Courses
Created with over a decade of experience and thousands of feedback.
Python online compiler
JavaScript online compiler
SQL online compiler
Java online compiler
HTML online compiler
C online compiler
C++ online compiler
C# online compiler
PHP online compiler
Swift online compiler
Kotlin online compiler
TypeScript online compiler
Go online compiler
Rust online compiler
Scala online compiler
Dart online compiler
R online compiler
Ruby online compiler
C exp()
The exp() function computes e (2.71828) raised to the power of the given argument.
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?