Mencari Nilai Tertinggi


‘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 max

max=A(0)

for i=0 to num -1

if max < A(i) then

max=A(i)

end if

next

end sub

One response to “Mencari Nilai Tertinggi

  1. Buatlah program menampilkan n baris dari barisan bilangan sebagai berikut
    1 2 3 4 5 6 7 8
    2 3 4 5 6 7 8 1
    3 4 5 6 7 8 1 2
    4 5 6 7 8 1 2 3
    jika da soalini kira2 gmn ya?

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