w3resource

C cosh() function

C cosh() function - Calculate Hyperbolic Cosine

Syntax:

double cosh(double x)

The cosh() function is used to calculate the hyperbolic cosine of x. The value x is expressed in radians.

Parameters:

Name Description Required /Optional
x Expressed in radians. Required

Return value from cosh()

  • Returns the hyperbolic cosine of x.

Example: cosh() function

The following example shows the usage of cosh() function:


#include <math.h>
#include <stdio.h>
 
int main(void)
{
   double x, y;
 
   x = 0;
   y = cosh(x);
   printf("cosh( %lf ) = %lf\n", x, y);
   x = 1;
   y = cosh(x);
   printf("\ncosh( %lf ) = %lf\n", x, y);
   x = 7.3;
   y = cosh(x);
   printf("\ncosh( %lf ) = %lf\n", x, y);
}

Output:

cosh( 0.000000 ) = 1.000000

cosh( 1.000000 ) = 1.543081

cosh( 7.300000 ) = 740.150302

C Programming Code Editor:

Previous C Programming: C cos()
Next C Programming: C sin()



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/c-programming/math/c-cosh.php