Code:
Module Module1
Sub Main()
Dim ar As Integer()
Dim max As Integer
ar = New Integer() {15, 8, 1, 6, 34, 7, 5, 342, 4, 7}
max = ar(0)
For i = 1 To ar.GetUpperBound(0)
If ar(i) > max Then
max = ar(i)
End If
Next
Console.Write("The Maximum value of the elements of array is: {0}", max)
Console.ReadLine()
End Sub
End Module