Positive and Negative Number Checker
Posted: 2020-01-02
By: JakeRPomperada
Viewed: 184
Filed Under:
No attachments for this post
A simple program that I wrote using Microsoft Visual Basic 5 to check if the given integer number by our user is a positive or negative number. The program code is very simple and easy to understand.
Private Sub Command1_Click()
number_value = Val(Text1.Text)
If (number_value >= 0) Then
Label4.Caption = "The given number " & number_value & " is a Positive Number."
Else
Label4.Caption = "The given number " & number_value & " is a Negative Number."
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label4.Caption = " "
End Sub
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.