Module Module1
Sub Main()
Dim counter, sum As Integer
Dim average As Double
Dim numberArray(10) As Integer
Console.writeLine("Enter the Numbers : ")
sum = 0
For counter = 0 To 9
Console.write("Number " & (counter + 1) & " : ")
numberArray(counter) = Console.ReadLine()
sum += numberArray(counter)
Next counter
average = sum / 10
Console.writeLine("Average of 10 Numbers is : " & average)
Console.writeLine("Handle IndexOutOfRangeException")
Try
sum = numberArray(15)
Console.WriteLine("No Exception occured!!!")
Catch ioore As IndexOutOfRangeException
Console.WriteLine("Exception : Index is Out Of Range")
Finally
Console.WriteLine("Finally Block Executed!!")
Console.ReadLine()
End Try
End Sub
End Module