Calculates the hyperbolic cosine of a number #include <math.h> double The hyperbolic cosine of any number ^{x} + e^{-x})/2 and is always greater than or equal to 1. If the result of cosh( ) is too great for the double type, the function incurs a range error.## Exampledouble x, sum = 1.0; unsigned max_n; printf("Cosh(x) is the sum as n goes from 0 to infinity " "of x^(2*n) / (2*n)!\n"); // That's x raised to the power of 2*n, divided by 2*n factorial. printf("Enter x and a maximum for n (separated by a space): "); if (scanf(" %lf %u", &x, &max_n) < 2) { printf("Couldn't read two numbers.\n"); return -1; } printf("cosh(%.2f) = %.4f;\n", x, With the numbers 1.72 and 3 as input, the program produces the following output: cosh(1.72) = 2.8818; Approximation by series of 4 terms = 2.8798. ## See AlsoThe C99 inverse hyperbolic cosine function |