Skip to content
Home » VB 6 – Abs() Function

VB 6 – Abs() Function

    In this example, we will use Abs() math function of Visual Basic 6 to find absolute value of a number.

    Program Code: Abs( ) Function

    Private Sub Command1_Click()
    Dim Absolute As Integer
    Absolute = Abs(Val(Text1.Text))
    MsgBox ("The Absolute value is" & " " & Absolute)
    End Sub

    Output : Abs ( ) Function

    Output - Absolute Function
    Figure 1 – Output – Absolute Function