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
Figure 1 – Output – Cos Function


Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.