Public Class Form1
Dim b As Integer
Dim i As Integer
Dim c As Integer
Dim a() As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
b = TextBox1.Text
c = TextBox1.Text
ReDim a(b)
For i = 1 To b
a(i) = InputBox("Ingrese Datos")
c = a(i)
TextBox2.Text = TextBox2.Text & " " & c
If a(i) > b Then
b = a(i)
Else
If a(i) < c Then
c = a(i)
End If
End If
Next
MsgBox("el mayor es " & b)
MsgBox("el menor es " & c)
End Sub
End Class