I am creating an array that will contain 24 numbers and display them in a table. I used "arrayname" .Max (); to determine the largest number, but I need to display the array slot with the highest number
eg. hour 15 had the largest number, so the message will display 15, not the number assigned to 15.
My code is as follows:
public void busiest(int[] A)
{
int busy;
busy = A.Max();
Console.WriteLine("\nThe busiest time of day was hour " + busy);
}
Can someone tell if I am missing something simple to display the slot, and not the assigned number?
thank
source
share