You are on page 1of 6

ARRAY BIDIMENSIONAL

Dim matriz1(3, 3), matriz2(3, 3), suma(3, 3) As Integer Dim x, y As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For x = 1 To 3 For y = 1 To 3 matriz1(x, y) = InputBox("ingrese numero en la posicion" & Str(x)) Next Next For x = 1 To 3 ListBox1.Items.Add(Str(matriz1(x, 1)) & " " & Str(matriz1(x, 2)) & " " & Str(matriz1(x, 3))) Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click For x = 1 To 3 For y = 1 To 3 matriz2(x, y) = InputBox("ingrese numero en la posicion" & Str(y)) Next Next For x = 1 To 3 ListBox2.Items.Add(Str(matriz2(x, 1)) & " " & Str(matriz2(x, 2)) & " " & Str(matriz2(x, 3))) Next End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click For x = 1 To 3 For y = 1 To 3 suma(x, y) = matriz1(x, y) + matriz2(x, y) Next Next For x = 1 To 3 ListBox3.Items.Add(Str(suma(x, 1)) & " " & Str(suma(x, 2)) & " " & Str(suma(x, 3))) Next End Sub End Class

You might also like