Option Explicit

Dim A(20), num, i, j, max As Integer

Private Sub form_load()
‘Input nilai
num = InputBox(“Inisialisasi array : “)
For i = 0 To num – 1
A(i) = InputBox(“Masukkan jumlah array : “)
Next i

‘Cari Nilai Max
max = A(0)
For i = 0 To num – 1
If max < A(i) Then
max = A(i)
End If
Next

‘  Tampilkan nilai max
Print “Jumlah Array : ”
For i = 0 To num – 1
Print A(i)
Next i
Print “Value; Tertinggi = “; max; “”
End Sub

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s