In this exercise solution about having numbers entered and separated by commas and finding the max, I don’t understand what “// Assume the first number is the max” means. At first I thought it meant that the first number entered in the list had to be the max but the finished program does not care where the max was entered. I also don’t understand what the line under it is doing. Any help is appreciated.
Console.Write("Enter comma separated numbers: ");
var input = Console.ReadLine();
var numbers = input.Split(',');
**// Assume the first number is the max **
** var max = Convert.ToInt32(numbers[0]);**
foreach (var str in numbers)
{
var number = Convert.ToInt32(str);
if (number > max)
max = number;
}
Console.WriteLine("Max is " + max);