Your problem is in the
Console.Write
function - you forgot to put the index for the variable to be shown in the output. You should also add a
Console.ReadKey();
call at the end of the
Main
method because you will, otherwise, not see the output when you start the program from Visual Studio...
static void GetMax(int[] array)
{
if ((array[0]) > (array[1]))
{
Console.Write("Number {0} is > than {1}", array[0], array[1]);
}
else if ((array[0]) < (array[1]))
{
Console.Write("Number {0} is < than {1}", array[0], array[1]);
}
else
{
Console.Write("Number {0} and {1} are equal", array[0], array[1]);
}
}