' Visual Basic 2008 9.0 .NET Examples - Introduction to Arrays - Arrays : Module Exercise6Solution Sub Main() Dim count As Integer = 10 Dim upperbound As Integer = count - 1 Dim values1(upperbound) As Integer Dim values2(upperbound) As Integer Dim values3(upperbound) As Integer Dim index As Integer ' For index = 0 To upperbound values1(index) = index + 1 Next ' Console.WriteLine("Array 1 :") For index = 0 To upperbound Console.WriteLine("element " & (index + 1) & _ " ( index " & index & " ) : " & _ values1(index)) Next Console.WriteLine() ' For index = 0 To upperbound values2(index) = count - index Next ' Console.WriteLine("Array 2 :") For index = 0 To upperbound Console.WriteLine("element " & (index + 1) & _ " ( index " & index & " ) : " & _ values2(index)) Next Console.WriteLine() ' For index = 0 To upperbound If values1(index) >= values2(index) Then values3(index) = values1(index) Else values3(index) = values2(index) End If Next ' Console.WriteLine("Array 3 :") For index = 0 To upperbound Console.WriteLine("element " & (index + 1) & _ " ( index " & index & " ) : " & _ values3(index)) Next Console.WriteLine() ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.