Home » C++ programming language

sinh() function with example in C++

C++ sinh() function: Here, we are going to learn about the sinh() function with example of cmath header in C++ programming language?
Submitted by IncludeHelp, on April 28, 2019

C++ sinh() function

sinh() function is a library function of cmath header, it is used to find the hyperbolic sine of the given value (hyperbolic angle), it accepts a number (x) and returns the hyperbolic sine of x.

Syntax of sinh() function:

    sinh(x);

Parameter(s): x – is the number (hyperbolic angel) to be used to calculate the hyperbolic sine.

Return value: double – it returns double type value that is the hyperbolic sine of hyperbolic angle x.

Example:

    Input:
    float x = 2.45;
    
    Function call:
    sinh(x);    
    
    Output:
    5.75103

C++ code to demonstrate the example of sinh() function

// C++ code to demonstrate the example of 
// sinh() function

#include <iostream>
#include <cmath>
using namespace std;

// main() section
int main()
{
    float x;
    
    x = -10.23;
    cout<<"sinh("<<x<<"): "<<sinh(x)<<endl;

    x = 0;
    cout<<"sinh("<<x<<"): "<<sinh(x)<<endl;    

    x = 2.45;
    cout<<"sinh("<<x<<"): "<<sinh(x)<<endl;    
    
    return 0;
}

Output

sinh(-10.23): -13861.2
sinh(0): 0
sinh(2.45): 5.75103

Reference: C++ sinh() function

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT


Top MCQs

Comments and Discussions!




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.