Exponential() in CExponential in mathematicsIt 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 ProgrammingIn 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 ProgrammingParameter for exp() functionThe 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() functionThe 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 ProgramBelow is the code to implement the exp() function in C Program. Output: User Input for Computing the Exponential ValueOutput: 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
|
Javatpoint provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India