In C programming language, exp function in C. returns the value of e raised to the xth power.
exp() : In the C programming language, The exp() function calculates e raised to the power of x(given argument)
( calculate the exponential “e” to the xth power)
The declaration of the exp() function in the C Language
double exp (double value);
the parameter of the exp() function is
x – This is the floating point value
The argument for exp() can be any value, either positive or negative
The exp() function returns the result of e raised to the power of x
In the this Language, the required header of the exp() is:
#include<math.h>
The following example shows the usage of the exp function
#include <stdio.h> #include <stdlib.h> int main() { double x=2.1,y=1; printf("exp value of %f is %f\n",x,exp(x)); printf("exp value of %f is %f\n",y,exp(y)); getch(); return 0; }
When the above program is compiled, it will produce the following result
exp value of 2.100000 is 8.166170
exp value of 1.000000 is 2.718282
Program 2
#include <stdio.h> #include <math.h> int main() { double m,n;//diclare of local variable printf("Enter the a value for find exponential :"); //get input for calculate sinh scanf("%lf",&m); printf("Enter the a value for find exponential :"); //get input for calculate sinh scanf("%lf",&n); printf("exp value of the %lf is: %lf\n",m,exp(m)); printf("exp value of the %lf is: %lf",n,exp(n)); getch(); return 0; }
When the above program is compiled, it will produce the following result
Enter a value for find exponential :2 Enter a value for find exponential :4 exp value of the 2.000000 is :7.389056 exp value of the 4.000000 is :54.598150
Similar functions
Other C programming language functions that are similar to the cosine function
Suggested for you
suggested for you
User defined function in C language
Arithmetic functions in C Language
PHP Star Triangle pattern program In this tutorial, we will discuss about PHP Star Triangle…
PHP Full Pyramid pattern program In this tutorial, we will discuss about PHP Full Pyramid…
5 methods to add two numbers in Java In this tutorial, we will discuss the…
Python full Pyramid star pattern program In this tutorial, we will discuss the concept of…
Write a function or method to convert C into F -Entered by the user In…
How to write a function or method to convert Celsius into Fahrenheit In this tutorial,…