Promedio con vectores Dim a, c, d, p As Integer a = TextBox1.Text d

Anuncio
Promedio con vectores
Dim a, c, d, p As Integer
a = TextBox1.Text
d=0
p=0
Dim b(0 To a) As Integer
For c = 1 To a
b(c) = InputBox("Numero " & c)
Next
For c = 1 To a
d = d + b(c)
Next
p=d/a
TextBox3.Text = p
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
TextBox1.Text = ""
TextBox3.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button3.Click
End
End Sub
End Class
Descargar