Showing posts with label divide two numbers in vb 6. Show all posts
Showing posts with label divide two numbers in vb 6. Show all posts

Monday, August 14, 2017

Divide Two Numbers in Visual Basic 6

A very simple program that I wrote using Microsoft Visual Basic 6 to ask the user to give two numbers and then our program will compute the quotient of the two numbers given by our user. The code is very short and easy to understand. I hope you will learn something on this one. Thank you.

I hope you will find my work useful and beneficial. If you have some questions about programming, about my work please send mu an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com. People here in the Philippines can contact me at  my mobile number 09173084360.

Thank you very much and Happy Programming.







Sample Program Output


Program Listing

' Written By: Mr. Jake R. Pomperada, MAED-IT
' August 14, 2017
' Mandaluyong City, Metro Manila
' Visual Basic 6


Private Sub Command1_Click()
Dim solve As Integer
Dim a As Integer
Dim b As Integer

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

solve = (a / b)

Label3.Caption = "The Division of Two Numbers is " & Trim(Val(solve)) & "."
End Sub

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

Private Sub Command3_Click()
End
End Sub