' Visual Basic 2008 9.0 .NET Examples - Sorting Arrays - Arrays : Module Example Sub Main() Dim count As Integer = 5 Dim upperbound As Integer = count - 1 Dim numbers(upperbound) As Integer ' Dim index As Integer Dim random As Random = New Random For index = 0 To upperbound numbers(index) = random.Next(1, 101) Next ' Console.Write("unsorted array : ") For index = 0 To upperbound Console.Write(numbers(index) & " ") Next Console.WriteLine() ' Array.Sort(numbers) ' Console.Write("sorted array : ") For index = 0 To upperbound Console.Write(numbers(index) & " ") Next ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.