02 December, 2013

A Visual Basic 6.0 Language to Determine if a Number is Negative or Not

 NOTE THAT THIS IS NOT TO TEACH YOU BUT TO GIVE YOU HINTS AND INSIGHTS ON WHAT TO DO.
This is a simple thing to do making use of the IF ELSE statement
You first set up the command button in the form and fix the code in.

Private Sub Command1_Click()
Dim n As Double
n = InputBox("input integer")
If n < 0 Then
Print "Negetive"
Else: Print "NOT NEGATIVE"
End If
End Sub

Then you run the program and input random values to test it.
The code is as easy as it looks, all you need is the logic.

STAY TUNED FOR MORE OF THE BASICS OF V.B. CODES

No comments:

Post a Comment