public static void Main()
int[] array = {-5, -1, 4, 10, 22};
int minNumber = Int32.MaxValue;
int maxNumber = Int32.MinValue;
for(int i = 0; i < array.Length; ++i)
if(array[i] < minNumber) minNumber = array[i];
if(array[i] > maxNumber) maxNumber = array[i];
Console.WriteLine("Valor mínimo no array: " + minNumber);
Console.WriteLine("Valor máximo no array: " + maxNumber);