0% found this document useful (0 votes)
29 views3 pages

Dim As Integer: Matriz (3, 3)

The document defines procedures to input values into 3x3 matrices, display the matrices in list boxes, and calculate the sum of two matrices by adding the corresponding elements and displaying the results. Matrix values are input from the user and stored in the arrays. Individual elements are retrieved and displayed or summed using nested for loops iterating over the rows and columns of the matrices.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Dim As Integer: Matriz (3, 3)

The document defines procedures to input values into 3x3 matrices, display the matrices in list boxes, and calculate the sum of two matrices by adding the corresponding elements and displaying the results. Matrix values are input from the user and stored in the arrays. Individual elements are retrieved and displayed or summed using nested for loops iterating over the rows and columns of the matrices.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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