How do you display the answer in as a decimal?
This code calculates the average of an array of integers. I know the answer is 6.88, but I cannot get it to display this way. I have tried using the following data types: integer, double, float, long, and, decimal. I have also tried using memberList.Format(0.00); using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { class CalcAverages { } static void Main(string[] args) { int[] memberList = new int[8] { 2, 4, 9, 12, 3, 2, 15, 8}; Console.WriteLine(memberList.Sum()); double average = memberList.Sum() / memberList.Length; Console.WriteLine(average); } } }