pre-define maths function in C

cosh arithmetic function in C language with example

cosh arithmetic function in C language with example

In this tutorial, we will describe about cosh arithmetic function in C language with example.

Description of cosh()

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.

Declaration of cosh() function

Syntax

The syntax for the cosh function in C programming Language is

double cosh(double x);

Parameter or Arguments list

x is the parameter of this function

 

Returns

The cosh function returns hyperbolic cos value of x, measured in radians.

 

Required header

The required header file for the cosh function in the C programming  language is

#include <math.h>

Example

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      

cosh function   in C  language                               

sinh function in C language

tanh function in C language

abs function in C language

floor function in C language

ceil function in C language

round function in C language

 

suggested for you

Function in C language

User defined function in C language

Arithmetic functions in C Language

String function in C language

 

sinh arithmetic function in C language with example
exp function in C programming language
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

Recent Posts

How to find reverse number using method in Java

How to find reverse number using method In this article, we will discuss the concept…

9 hours ago

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

3 weeks ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

1 month ago

Program to count vowels,consonants,words, characters and space in Java

Program to count vowels, consonants, words, characters and space in Java In this article, we…

1 month ago

How to print multiplication table using Array in C++ language

How to print multiplication table using Array in C++ language In this post, we will…

1 month ago

C Program to multiplication table using Array

C Program to multiplication table using Array In this tutorial , we will discuss about…

2 months ago