Powered By Blogger

Kamis, 31 Maret 2011

latihan soal uts


Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a, b, c, d, f, g, j As Integer
a = 7
b = 8
For f = Val(TextBox1.Text) To Val(TextBox2.Text)
If f Mod 3 = 0 Or f Mod 4 = 0 Or f Mod 7 = 0 Then
ListBox1.Items.Add(f)
Else
j = f
ListBox2.Items.Add(j)
End If
Next
For g = Val(TextBox1.Text) To Val(TextBox2.Text)

Next

For c = Val(TextBox1.Text) To Val(TextBox2.Text)
If c Mod a = 0 Then
d = c
ListBox3.Items.Add(d)
Else
If c Mod b = 0 Then
d = c
ListBox3.Items.Add(d)
End If
End If
Next

End Sub
Sub bersih()
TextBox1.Text = ""
TextBox2.Text = ""
ListBox1.Items.Clear()
ListBox2.Items.Clear()
ListBox3.Items.Clear()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Call bersih()
End Sub
End Class

Tidak ada komentar:

Posting Komentar