' Visual Basic 2008 9.0 .NET Examples - Introduction to Arrays - Arrays : Module Exercise4Solution Sub Main() Dim count As Integer = 10 Dim upperbound As Integer = count - 1 Dim values(upperbound) As Integer Dim index As Integer ' For index = 0 To upperbound values(index) = index + 1 Next ' For index = 0 To upperbound Console.WriteLine("element " & (index + 1) & _ " ( index " & index & " ) : " & _ values(index)) Next Console.WriteLine() ' Dim backup As Integer For index = 0 To (count \ 2) - 1 backup = values(index) values(index) = values(upperbound - index) values(upperbound - index) = backup Next ' For index = 0 To upperbound Console.WriteLine("element " & (index + 1) & _ " ( index " & index & " ) : " & _ values(index)) Next ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.