The program first asks the user for the number of elements to be stored in the array, then asks for the numbers. This is my code
static void Main
Besides on your problem, you can use Enumerable.Min and Enumerable.Max methods like;
int[] numbers = new int[]{1, 2, 3 ,4}; Console.WriteLine(numbers.Min()); //1 Console.WriteLine(numbers.Max()); //4
Don't forget to add System.Linq namespace.