Math.Cosh() Method in C#


The Math.Cosh() method in C# is used to return the hyperbolic cosine of the angle specified as a parameter.

Syntax

Following is the syntax −

public static double Cosh (double val);

Above, Val is an angle.

Example

Let us now see an example to implement Math.Cosh() method −

using System;
public class Demo {
   public static void Main(){
      double val1 = 30.0;
      double val2 = 45.0;
      Console.WriteLine(Math.Cosh(val1));
      Console.WriteLine(Math.Cosh(val2));
   }
}

Output

This will produce the following output −

5343237290762.23
1.74671355287425E+19

Example

Let us see another example to implement Math.Cosh() method −

using System;
public class Demo {
   public static void Main(){
      double val1 = 0.0;
      double val2 = 1.1;
      Console.WriteLine(Math.Cosh(val1));
      Console.WriteLine(Math.Cosh(val2));
   }
}

Output

This will produce the following output −

1
1.66851855382226

Updated on: 08-Nov-2019

26 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements