Sunday, 27 November 2016

Visual Basic 6.0 program to find the largest of two numbers

Interface














Program Code
Private Sub cmdResult_Click()
Label4.FontBold = True
If (Val(Text1.Text)) > (Val(Text2.Text)) Then
Label4.Caption = "The largest number is " + Text1.Text
Else
Label4.Caption = "The largest number is " + Text2.Text
End If
End Sub

Private Sub Form_Load()
Text1.Text = InputBox("Enter the first number")
Text2.Text = InputBox("Enter the Second number")
End Sub

No comments:

Post a Comment