You are on page 1of 3

Dim matriz(3, 3) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim x, y As Integer For x = 1 To 3 For y = 1 To 3 matriz(x, y) = InputBox("ing nro" & Str(x) & "," & Str(y)) Next Next For x = 1 To 3 ListBox1.Items.Add(Str(matriz(x, 1)) & " " & Str(matriz(x, 2)) & " " & Str(matriz(x, 3))) Next End Sub

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("ing nro en la posicion " & Str(x) & "," & Str(y)) Next Next ListBox1.Items.Clear() 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("ing nro en la posicion " & Str(x) & "," & Str(y)) Next Next ListBox2.Items.Clear() 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 ListBox3.Items.Clear() For x = 1 To 3 ListBox3.Items.Add(Str(suma(x, 1)) & " " & Str(suma(x, 2)) & " " & Str(suma(x, 3))) Next End Sub

You might also like