VB 6 – Cos Function

The Cos function in VB 6 returns the cosine value of a degree. When you enter a degree value in the program, it gives you a real value, that is, the Cosine value.

The program code is given below along with output.

Program Code: Cos Function

Private Sub Command1_Click()
Dim Cosine As Double

Cosine = Cos(Val(Text1.Text))

MsgBox ("The Cosine value is" & " " & Cosine)

End Sub

Output: Cos Function

Output - Cos Function
Output Cos Function