double [] prices = new double[7];
void Main() { decimal[] ProductPrice ={10,20,30,40,50,60,70}; [edit]Average method can be used[/edit] // decimal avgPrice = ProductPrice.Sum() / ProductPrice.Length; avgPrice = ProductPrice.Average(); Console.WriteLine ("The average of prices = {0}",avgPrice); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)