Ejercicio Vectores (suma Y Orden)

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ejercicio Vectores (suma Y Orden) as PDF for free.

More details

  • Words: 157
  • Pages: 1
Ejercicio vectores Dim num As String Dim vec(4) As Integer Dim num2 As String Dim vec2(4) As Integer Dim suma(4) As Integer Dim x As Integer Dim y As Integer Private Sub ingresar_Click() For x = 0 To 4 num = InputBox("Ingrese un numero para almacenar en el vector 1", "Ingreso") vec(x) = Val(num) Next x For x = 0 To 4 num2 = InputBox("Ingrese un numero para almacenar en el vector 2", "Ingreso") vec2(x) = Val(num2) Next x For x = 0 To 4 suma(x) = vec(x) + vec2(x) List1.AddItem suma(x) Next x For x = 0 To 4 For y = 0 To 3 If (suma(y) > suma(y + 1)) Then temp = suma(y) suma(y) = suma(y + 1) suma(y + 1) = temp End If Next y Next x For x = 0 To 4 List2.AddItem suma(x) Next x End Sub Private Sub limpiar_Click() List1.Clear List2.Clear End Sub Private Sub salir_Click() End End Sub

Related Documents