How To Re Assign Array In Console Application?
By Goniey N
Reassign The Array Of Your Array In Console Application...
Sub Main()
Dim a(5), i, n, lb, ub, length, p As Integer
Console.WriteLine("Enter the Five Number:=>")
For i = 1 To 5
a(i)
= Console.ReadLine()
lb
= a.GetLowerBound(0)
ub
= a.GetUpperBound(0)
length
= a.GetLength(0)
Next i
Console.WriteLine("LowerBound:=>" & lb)
Console.WriteLine("UpperBound:=>" & ub)
Console.WriteLine("Length:=>" & length)
For i = 1 To 5
Console.WriteLine("ARRAY:=>" & a(i))
Next i
ReDim Preserve a(10)
Console.WriteLine("Enter the Five Number:=>")
For i = 6 To 10
a(i)
= Console.ReadLine()
lb
= a.GetLowerBound(0)
ub
= a.GetUpperBound(0)
length
= a.GetLength(0)
Next i
Console.WriteLine("LowerBound:=>" & lb)
Console.WriteLine("UpperBound:=>" & ub)
Console.WriteLine("Length:=>" & length)
For i = 6 To 10
Console.WriteLine("ARRAY:=>" & a(i))
Next i
Console.WriteLine(" ||=================||")
Console.WriteLine(" || The Whole Array ||")
Console.WriteLine(" ||=================||")
For i = 1 To 10
Console.WriteLine("A(" & i & ") = " & a(i))
Next i
Console.ReadLine()
End Sub
How To Re Assign Array In Console Application? (400 Views)