0% found this document useful (0 votes)
34 views2 pages

Nina Medina Alvaro Benjamin Ing. Industrial

This document contains 4 code examples in Visual Basic that demonstrate working with arrays and matrices. The first example stores user input values in an array and then outputs them in reverse order. The second example counts the number of zeros in a 2D array. The third finds the maximum value in a 2D array of sales data. The fourth adds corresponding elements of two 2D arrays and outputs the results.

Uploaded by

AR Herrera
Copyright
© © All Rights Reserved
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)
34 views2 pages

Nina Medina Alvaro Benjamin Ing. Industrial

This document contains 4 code examples in Visual Basic that demonstrate working with arrays and matrices. The first example stores user input values in an array and then outputs them in reverse order. The second example counts the number of zeros in a 2D array. The third finds the maximum value in a 2D array of sales data. The fourth adds corresponding elements of two 2D arrays and outputs the results.

Uploaded by

AR Herrera
Copyright
© © All Rights Reserved
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/ 2

Nina Medina Alvaro Benjamin

Ing. Industrial
5.
#65
Module Module1

Sub Main()

Dim v(6) As Integer


Dim k(6) As Integer
Dim res As Integer
Dim i As Integer

For i = 0 To 5 Step 1
v(i) = InputBox("ingresar valores")
Next
res = i
For i = 5 To 0 Step -1
k(i) = v(i)
res = res & k(i) & ""
Next
MsgBox(res)

6.
Dim v(4, 4) As Integer
Dim i As Integer
Dim nc As Integer
Dim j As Integer
nc = 0
For i = 0 To 3
For j = 0 To 3
v(i, j) = InputBox("ingresar datos")
Next
nc = 0
For i = 0 To 3
For j = 0 To 3
If v(i, j) = 0 Then
nc = nc + 1
End If
Next
Next
Next
MsgBox(nc)

7.
Dim i As Integer
Dim j As Integer
Dim v(5, 5) As Integer
Dim m As Integer
For i = 0 To 4
For j = 0 To 4
v(i, j) = InputBox("ingresar las ventas")
Next
Next
m = v(i, j)
For i = 0 To 4
For j = 0 To 4
If v(i, j) > m Then
m = v(i, j)
End If
Next
Next
MsgBox(m)

8.
Dim m As Integer
Dim n As Integer
Dim X(m, n) As Integer
Dim Y(m, n) As Integer
Dim Z(m, n) As Integer
Dim i As Integer
Dim j As Integer
m = InputBox("ingrese un numero")
n = InputBox("ingrese un numero")
For i = 0 To m
For j = 0 To n
X(i, j) = InputBox("ingrese numero")
Y(i, j) = InputBox("ingrese numero")
Next
Next
For i = 0 To m
For j = 0 To n
Z(i, j) = X(i, j) + Y(i, j)
Next
Next
For i = 0 To m
For j = 0 To n
MsgBox(Z(i, j))
Next
Next

End Sub

End Module

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy