Private Sub Command1_Click()
Dim n As Integer
Dim x As Single
Dim a As Integer, b As Integer
Dim i As Integer
n = Val(Text1)
For i = 1 To n
Randomize
x = Rnd
If x > 0.5 Then
a = a + 1
Else
b = b + 1
End If
Next i
Label3.Caption = a
Label4.Caption = b
End Sub
Private Sub Form_Load()
Text1.Text = ""
Label3.Caption = ""
Label4.Caption = ""
End Sub