Calculate Average of numbers using LINQ

Rajesh_Kumar
Posted by Rajesh_Kumar under C# category on | Points: 40 | Views : 597
using System;
using System.Linq;

int[] arr_numbers = {1,2,3,4,5,6,7,8,9,10};
double avg_of_numbers = arr_numbers.Average();
Response.Write(avg_of_numbers.ToString());


Output woulbe be : 5.5

Comments or Responses

Login to post response