C cosh 函数是一个数学函数,用于计算给定值或表达式的双曲余弦值。cosh 函数的语法如下所示。
double cosh(double number);
cosh 函数示例
math cosh 函数允许您查找给定值的双曲余弦值。在此程序中,我们将查找不同数据类型值的双曲余弦值并显示输出。
#include <stdio.h>
#include <math.h>
int main()
{
printf("\n The Hyperbolic Cosine Value of 0 = %.4f ", cosh(0));
printf("\n The Hyperbolic Cosine Value of 1 = %.4f ", cosh(1));
printf("\n The Hyperbolic Cosine Value of 10.25 = %.4f ", cosh(10.25));
printf("\n The Hyperbolic Cosine Value of 2.59 = %.4f ", cosh(2.59));
printf("\n The Hyperbolic Cosine Value of -7.23 = %.4f ", cosh(-7.23));
printf("\n The Hyperbolic Cosine Value of -4.32 = %.4f ", cosh(-4.32));
return 0;
}

cosh 示例 2
在此 C 编程 示例中,我们允许用户输入他们的值。接下来,此 程序 使用 math cosh 函数来查找用户给定数字的双曲余弦值。
#include <stdio.h>
#include <math.h>
int main()
{
float number, coshValue;
printf(" Please Enter any Numeric Value : ");
scanf("%f", &number);
coshValue = cosh(number);
printf("\n The Hyperbolic Cosine Value of %.2f = %.4f ", number, coshValue);
return 0;
}
Please Enter any Numeric Value : 9.34
The Hyperbolic Cosine Value of 9.34 = 5692.2051