Home >>VB.Net Programs >VB.Net Program to find the tangent value for the specified angle
Here, for the defined angle, we can find the tangent value and print the result on the console screen.
Program :
Below is the source code for determining the tangent value for the angle defined. The program given is compiled and successfully executed.
Example
Module Module1
Sub Main()
Dim tangent As Double = 0
tangent = Math.Tan(2)
Console.WriteLine("Tangent is: {0}", tangent)
tangent = Math.Tan(0.3584)
Console.WriteLine("Tangent is: {0}", tangent)
tangent = Math.Tan(0.0)
Console.WriteLine("Tangent is: {0}", tangent)
End Sub
End Module
Explanation:
We created a Module1 module in the program above that contains the Main() method. We generated a variable tangent initialized with 0 in the Main() method.
tangent = Math.Tan(2) Console.WriteLine("Tangent is: {0}", tangent) tangent = Math.Tan(0.3584) Console.WriteLine("Tangent is: {0}", tangent) tangent = Math.Tan(0.0) Console.WriteLine("Tangent is: {0}", tangent)
In the above code, for the defined angle values, the tangent value is found and then printed on the console screen.