In this tutorial, we will describe about cosh arithmetic function in C language with example.
cosh – arithmetic function in C language returns hyperbolic cosine value
cosh() : In the C Programming language, the coshh() function is used to calculate hyperbolic cosine value of given arguments.
Syntax
The syntax for the cosh function in C programming Language is
double cosh(double x);
x is the parameter of this function
The cosh function returns hyperbolic cos value of x, measured in radians.
The required header file for the cosh function in the C programming language is
#include <math.h>
Program 1
#include <stdio.h> #include <math.h> int main() { double x=0.5,y=1; printf("Hyperbolic cosine value of %f is %f\n",x,cosh(x)); printf("Hyperbolic cosine value of %f is %f\n",y,cosh(y)); getch(); return 0; }
When above program is compiled and run, it will produce the following result
hyperbolic Cosine value of 0.500000 is: 1.127626 hyperbolic Cosine value of 1.000000 is: 1.543081
program 2
#include <stdio.h> #include <math.h> int main() { //define the variable double coshValue; double inputValue; //get input from user printf("Please enter the value to calculate cosh value :"); scanf("%lf",&inputValue); //calculate the hyperbolic cosine value coshValue=cosh(inputValue); //display the hyperbolic cosine value printf("\nHyperbolic cosine value of %lf is %lf\n",inputValue,coshValue); getch(); return 0; }
When above program is compiled and run, it will produce the following result
Please enter the value to calculate cosh value :0.5 Hyperbolic cosine value of 0.500000 is 1,127626
Similar functions
Other C programming language functions that are similar to the cosine function
Other C programming language functions that are similar to the cosine function
suggested for you
User defined function in C language
Arithmetic functions in C Language
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…
Java program to check odd or even using recursion In this tutorial, we discuss a…