VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Compare to numbers together, to find which is bigger, or if there the same.

by KentuckyFriedEgg (1 Submission)
Category: Math/Dates
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 5th August 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Compare to numbers together, to find which is bigger, or if there the same.

API Declarations


dim ilnumber As String

Rate Compare to numbers together, to find which is bigger, or if there the same.



create a label and call it lblcompare
-

Private Sub lblcompare_Click()
    lblcompare.BackColor = vbRed
    iknumber = InputBox("Enter Your First Number")  'Asks for your first number'
    ilnumber = InputBox("Enter Your Second Number") 'Input your second number via an input box
    If iknumber > ilnumber Then                     'If the first number is bigger then...'
    MsgBox "The First Number Is Bigger"             'Then this message is displayed'
    ElseIf ilnumber > iknumber Then                 'If the number is smaller....'
    MsgBox "The Second Number Is Bigger"            'Then this message is displayed'
    Else                                            'But if there both the same'
    MsgBox "There Are Equal"                        'This message is displayed'
    End If
    lblcompare.BackColor = vbWhite                  'This changes the button back to white'
End Sub

Download this snippet    Add to My Saved Code

Compare to numbers together, to find which is bigger, or if there the same. Comments

No comments have been posted about Compare to numbers together, to find which is bigger, or if there the same.. Why not be the first to post a comment about Compare to numbers together, to find which is bigger, or if there the same..

Post your comment

Subject:
Message:
0/1000 characters