Header file:
math.h
Synopsis:
double cosh(double x);
Description:
Returns hyperbolic cosine of x.
cosh function C example:
#include<stdio.h>
#include<math.h>
int main() {
double x, result;
printf("Enter your input:");
scanf("%lf", &x);
result = cosh(x * 3.14 / 180);
printf("Hyperbolic sine of %lf is %lf\n", x, result);
return 0;
}
#include<math.h>
int main() {
double x, result;
printf("Enter your input:");
scanf("%lf", &x);
result = cosh(x * 3.14 / 180);
printf("Hyperbolic sine of %lf is %lf\n", x, result);
return 0;
}
Output:
jp@jp-VirtualBox:~/cpgms/math$ gcc cosh.c -lm
jp@jp-VirtualBox:~/cpgms/math$ ./a.out
Enter your input:0
Hyperbolic cosine of 0.000000 is 1.000000
jp@jp-VirtualBox:~/cpgms/math$ ./a.out
Enter your input:0
Hyperbolic cosine of 0.000000 is 1.000000
No comments:
Post a Comment