Given an collection as 10, 12, 8, 5, 5. The objective is to find the average of numbers from the collection of numbers. The below program will do so
Imports System.Collections.Generic
Imports System.Linq
Namespace ConsoleApplication2
Class Program
Private Shared Sub Main(args As String())
Console.WriteLine(New List(Of Integer)() From { _
10, _
12, _
8, _
5, _
5 _
}.Average())
Console.ReadKey()
End Sub
End Class
End Namespace
Output: 8