Monday, April 10, 2017

Sum of Three Numbers in Visual Basic

Here is a program that will ask the user to give three numbers and then it will compute the total sum of the three numbers given by our user. I am using Visual Basic 5 in this sample program. Thank you.

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 As Integer

a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)

sum = (a + b + c)

Text4.Text = sum

End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End Sub



1 comment: