Finding Max Value


‘Finding Max Value ‘

Deklarasi Option Explicit Dim A(20)

 num, i, j, max As Integer

Private Sub Command1_Click()

Print “Jumlah Array:”

For i = 0 To num – 1 Print A(i)

Next i Print “Value Tertinggi= “; max End Sub Private Sub Form_Load()

num = InputBox(“Inisialisasi Array [1-20]:”)

For i = 0 To num – 1 A(i) = InputBox(“Masukkan Jumlah array:”) Next i ‘find maximum max

= A(0) For i = 0 To num – 1 If max < A(i) Then max = A(i)

 End If

 Next

 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