Monday, April 3, 2017

Addition of Two Numbers in Visual Basic 6

A very simple program that I wrote in Visual Basic 6 to ask the user to give two numbers and then our program will compute for the total sum of the two numbers. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

Private Sub Command1_Click()

Dim sum, val_1, val_2 As Integer

val_1 = Val(Text1.Text)
val_2 = Val(Text2.Text)

sum = (val_1 + val_2)

Label3.Caption = "The sum of " & val_1 & " and " & val_2 & " is " & sum & "."
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Label1.Caption = ""
Text1.SetFocus

End Sub

Private Sub Command3_Click()
End

End Sub


No comments:

Post a Comment