Jercicios Programacion Digita
Sub Main()
Dim arreglo(4) As Integer
Dim k, mayor, posicion As Integer
mayor = 0
posicion = 0
Console.WriteLine("ingrese losnumero : ")
For k = 0 To 4
arreglo(k) = Console.ReadLine
Next
Console.WriteLine(" el arreglo es : ")
For k = 0 To 4 Step 1Console.WriteLine("indice {0} = {1} ", k, arreglo(k))
Next
For k = 0 To 4
If (arreglo(k) >= mayor) Then
mayor = arreglo(k)
posicion = kEnd If
Next
Console.WriteLine(" le mayor es {0} y su posicon es {1} ", arreglo(posicion), posicion)
Console.ReadLine()
End Sub
End Module
ModuleModule1
Sub Main()
Dim size As Double
size = Console.ReadLine
Dim arreglo(size) As Integer
Call llenararreglo(arreglo, size)
Callimprimirarreglo(arreglo, size)
Call mayor(arreglo, size)
Console.ReadLine()
End Sub
Sub llenararreglo(ByRef A() As Integer, ByVal size As Integer)
Dim i As Double
For i= 0 To size Step 1
Console.WriteLine("ingrese valor para la posicion A[{0}]: ", i)
A(i) = Console.ReadLine()
Next
End Sub
Sub imprimirarreglo(ByRef A() AsInteger, ByVal size As Integer)
Dim i As Double
For i = 0 To size Step 1
Console.WriteLine("la posicion A[{0}] : {1}", i, A(i))
Next
End Sub
Submayor(ByRef A() As Integer, ByVal size As Integer)
Dim i As Double
Dim mayor, posicion As Double
For i = 0 To size Step 1
If (A(i) >= mayor) Thenmayor = A(i)
posicion = i
End If
Next
Console.WriteLine(" el mayor es {0} y su posicon es {1} ", A(posicion), posicion)
End Sub
End...
Regístrate para leer el documento completo.