Calculating Average of Numbers using LINQ.

vishalneeraj-24503
Posted by vishalneeraj-24503 under LINQ category on | Points: 40 | Views : 689
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:-
Output : 5.5

Comments or Responses

Login to post response