Find Max Value


Function maxi(n As Integer, n1 As Integer, _
n2 As Integer) As Integer
If (n1 > n) Then
n = n1
End If
If (n2 > n) Then
n = n2
End If
maxi = n
End Function

Sub bersih()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub

Private Sub Command1_Click()
Dim v1 As Integer, v2 As Integer, v3 As Integer
v1 = Val(Text1.Text)
v2 = Val(Text2.Text)
v3 = Val(Text3.Text)
big = maxi(v1, v2, v3)
MsgBox “Nilai terbesar adalah ” & _
big, , “Bilangan Terbesar”
End Sub

Private Sub Command2_Click()
bersih
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s