Setelah itu kita disign tampilan program seperti dibawah ini:
-Membuat text Bil Awal dengan Label
-serta membuat Isian dengan text
berikut berupa cooding yang di tempatkan pada tombol proses:
Private Sub Command1_Click()
List1.Clear
Awal = Int(Text1.Text)
Akhir = Int(Text2.Text)
For x = Awal To Akhir
z = 0
For y = 2 To x
hasil = x Mod y
If hasil = 0 Then
z = z + 1
End If
Next y
If ((z = 1) And (x > 1)) Then
List1.AddItem "Bil " & x
End If
Next x
End Sub

Tidak ada komentar:
Posting Komentar