Dim a, b As Single
Private Sub cmdDisplay_Click()
a = Val(txtFirstNumber.Text)
b = Val(txtSecondNumber.Text)
txtAddition.Text = a + b
txtExponentiation.Text = a ^ b
txtSubtraction.Text = a - b
txtMultiplication.Text = a * b
If b = 0 Then
MsgBox "Division by Zero is not Possible"
Else
txtIntegerDivision.Text = a \ b
txtRealDivision.Text = a / b
txtModulo.Text = a Mod b
End If
txtRealDivision.Text = Round(txtRealDivision.Text, 2)
End Sub
Private Sub Form_Load()
Me.Visible = True
txtFirstNumber.SetFocus
End Sub
No comments:
Post a Comment
Note: only a member of this blog may post a comment.