Pages

Sabtu, 05 Maret 2011

*** latihan VB.NET bag.1 ***
 
     soal 1
tampilkan bilangan yang habis dibagi 9 dan 27?

# nieh design nya sob!!!


# nieh hasil scribnya bozzz !!!

Public Class Form1

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

    End Sub


    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim j, u, y As Integer
        u = 9
        y = 27
        For j = 1 To Val(TextBox1.Text)
            If j Mod u = 0 Then
                ComboBox1.Items.Add(j)
                u = j
            Else
                If j Mod y = 0 Then
                    ComboBox1.Items.Add(j)
                    y = j


                End If


            End If
        Next
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    End Sub
End Class

# nieh hasilnya bos !!!


1 komentar: