In this tutorial, you will learn about C math library function cosh() that computes the hyperbolic cosine of the argument.
cosh()
is the standard C math library function that is defined in math library math.h
.
#include<math.h>
double cosh( double x );
where,
x = angle in radians ( floating point value )
This function returns the hyperbolic cosine value of x.
The return type is double.
/*Use of math library function cosh()*/
#include<stdio.h>
#include<math.h>
int main()
{
double x ;
x = 0.3;
//calculation of hyperbolic cosine
printf("\ncosh( %.3lf ) = %.3lf \n", x, cosh( x ));
x = -0.5;
//calculation of hyperbolic cosine
printf("\ncosh( %.3lf ) = %.3lf \n", x, cosh( x ));
x = 1.5;
//calculation of hyperbolic cosine
printf("\ncosh( %.3lf ) = %.3lf \n", x, cosh( x ));
return 0;
}
Output
Explanation
In the above program, we have calculated the hyperbolic cosine of x
.