ASP.NET Ejercicio 05


  • Ingresar un número entero y en pantalla mostrar sus divisores.

 Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim N, X As Integer
        N = TextBox1.Text
        ListBox1.Items.Clear()
     
        For X = 1 To N
            If N Mod X = 0 Then
                ListBox1.Items.Add(X)

            End If

        Next
    End Sub
End Class


No hay comentarios:

Publicar un comentario