You are on page 1of 2

Ordenar pares e impares

Public Class Form1


Dim x, lista(50), numero As Integer
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles
Button4.Click
ListBox1.Items.Clear()
For x = 1 To numero
ListBox1.Items.Add(lista(x))
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
numero = TextBox1.Text
For x = 1 To numero
lista(x) = InputBox("ingrese numero")
Next
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
ListBox1.Items.Clear()
For x = 1 To numero
If lista(x) Mod 2 = 0 Then
ListBox1.Items.Add(lista(x))
End If
Next
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles
Button5.Click
ListBox1.Items.Clear()
For x = 1 To numero
If lista(x) Mod 2 0 Then
ListBox1.Items.Add(lista(x))
End If
Next
End Sub
End Class

You might also like