Dim a(1 To 10) As Integer
Private Sub Command1_Click()
Randomize
For i = 1 To 10
a(i) = Int(Rnd * 101)
Print a(i);
Next i
End Sub
Private Sub Command2_Click()
Dim max As Integer, min As Integer
max = 0
min = 100
For i = 1 To 10
If max < a(i) Then max = a(i)
If min > a(i) Then min = a(i)
Next i
Print "max"; max; "min"; min
End Sub
Private Sub Command3_Click()
Dim ave As Double
For i = 1 To 10
ave = ave + a(i)
Next i
Print "ave"; ave / 10
End Sub