I am sure there is something stupid i am missing. I want to print the message to console window and in the same line show the max array value.
When i run the code without the console message it runs perfect but when i run the code with the message, it only shows the message and no max value.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Arrays
{
class Program
{
static void Main(string[] args)
{
int[] newArray = new int[6];
newArray[0] = 0;
newArray[1] = 1;
newArray[2] = 2;
newArray[3] = 49;
newArray[4] = 3;
newArray[5] = 82;
Console.Write("The highest number in the array is: ", newArray.Max());
Console.ReadLine();
}
}
}
I am just starting to get the hang of arrays but i cannot find a solution to the above problem.