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
How to find reverse number using method In this article, we will discuss the concept…
C# inverted full pyramid star pattern In this article, we will discuss the concept of…
C# Full Pyramid star pattern program In this article, we will discuss the concept of…
Program to count vowels, consonants, words, characters and space in Java In this article, we…
How to print multiplication table using Array in C++ language In this post, we will…
C Program to multiplication table using Array In this tutorial , we will discuss about…