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

PHP Star Triangle pattern program

PHP Star Triangle pattern program In this tutorial, we will discuss about PHP Star Triangle…

6 months ago

PHP Full Pyramid pattern program

PHP Full Pyramid pattern program In this tutorial, we will discuss about PHP Full Pyramid…

6 months ago

5 methods to add two numbers in Java

5 methods to add two numbers in Java In this tutorial, we will discuss the…

6 months ago

Python Full Pyramid star pattern program

Python full Pyramid star pattern program In this tutorial, we will discuss  the concept of…

9 months ago

Write a function or method to convert C into F -Entered by user

Write a function or method to convert C into F -Entered by the user In…

1 year ago

How to write a function or method to convert Celsius into Fahrenheit

How to write a function or method to convert Celsius into Fahrenheit In this tutorial,…

1 year ago