ADVERTISEMENT
ADVERTISEMENT

VB.Net program to find the tangent value for the specified angle

Here, we are going to learn how to find the tangent value for the specified angle in VB.Net?
Submitted by Nidhi, on December 02, 2020

Here, we will find the tangent value for the specified angle and print the result on the console screen.

Program/Source Code:

The source code to find the tangent value for the specified angle is given below. The given program is compiled and executed successfully.

'VB.Net program to find the tangent of 
'the specified angle.

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

Output:

Tangent is: -2.18503986326152
Tangent is: 0.374577262964287
Tangent is: 0
Press any key to continue . . .

Explanation:

In the above program, we created a module Module1 that contains the Main() method. In the Main() method we created a variable tangent initialized with 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)

In the above code, we find the tangent value for the specified angle values and then printed them on the console screen.

VB.Net Basic Programs »



ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.