Skip to content
Home ยป VB 6 – Sqr() Function

VB 6 – Sqr() Function

    In VB 6, the sqr() function gives the square root of any number. The argument for the sqr() function must be a Double mean a real number.

    In the example program below, we accept a number and return its square root.

    Program Code: Sqr() Function

    Private Sub Command1_Click()
    Dim result As Double
    result = Sqr(Val(Text1.Text))
    MsgBox (result)
    End Sub

    Output: Sqr() Function

    Output - Sqr() Function
    Figure 1 – Output – Sqr() Function