Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Module Module1

Sub Main()
Dim k As Integer
Console.WriteLine(" Programa ''Vector no se
repita n numetos 1-42''")
Console.WriteLine("Ingrese cuantos valores se van a mostrar")
k = Int(Console.ReadLine())
Dim v(k) As Single
LVECTOR(v, k)
MVECTOR(v, k)
Console.ReadLine()
End Sub
Sub LVECTOR(ByRef V() As Single, ByVal k As Integer)
For I = 1 To k Step 1
V(I) = Int((Rnd() * 42) + 1)
Next
For i = 1 To k
For a = i + 1 To k
While V(i) = V(a)
V(i) = Int((Rnd() * 42 + 1))
End While
Next
Next
End Sub
Sub MVECTOR(ByVal V() As Single, ByVal k As Integer)
For i = 1 To k Step 1
Console.WriteLine("{0}.- Los números {1} ", i, V(i))
Next
End Sub
End Module

You might also like