Javatpoint Logo
Javatpoint Logo

Exponential() in C

Exponential in mathematics

It can be described as the function that computes the power of any constant. It can be represented as a^x where a is a constant value. Usually, the constant value is e.

Exponential in C Programming

In C programming, we compute the exponential value of the constant e., e stands for Euler's number. The value of e is approximately 2.71828. The exp() function is defined in maths.h header file. So, if the

Syntax of exp() function in C Programming

Parameter for exp() function

The function only requires one parameter. The parameter stores the value by which the e is to be raised. Since the value for which the exponent is to be computed is constant.

Return Type for exp() function

The return type for the exp() function is double. It can be float or any other data type that can hold the numerical value.

Implementing exp() function in C Program

Below is the code to implement the exp() function in C Program.


Exponential() in C

User Input for Computing the Exponential Value


Exponential() in C

In the above example, we have taken the input from the user. It can be any float value once the user enters the value. It will be used to compute the exponential in the program, and it will be stored in the variable result. In the last statement, we will print the result. The answer will be displayed up to the sixth decimal place.

Next TopicFloat in C

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA