Sunday, 27 November 2016

Visual Basic 6.0 program to check given number is odd or even

Interface

Program Code:
Private Sub cmdResult_Click()

Label3.Caption = ""
Label3.FontBold = True
If (Val(Text1.Text)) Mod 2 = 0 Then
Label3.Caption = "EVEN"
Else
Label3.Caption = "ODD"
End If
End Sub

Private Sub cmdClear_Click()
Text1.Text = ""
Label3.Caption = ""
Text1.SetFocus
End Sub

Private Sub Form_Load()
Form3.Show
Text1.Text = InputBox("ENTER THE NUMBER TO CHECK")
End Sub

No comments:

Post a Comment