Question: 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(string[] args)
    {
        Console.Write("How many numbers do you want to store in array: ");
        int n = Convert.ToInt32(Console.ReadLine());
        int[] numbers = new int[n];
        int min = numbers[0];
        int max = numbers[0];

        for (int i = 0; i < n; i++)
        {
            Console.Write("Enter number {0}:  ", i+1);
            numbers[i] = Convert.ToInt32(Console.ReadLine());
        }

        for (int i = 0; i < n; i++)
        {
            if (min > numbers[i]) min = numbers[i];
            if (max < numbers[i]) max = numbers[i];
        }
        Console.WriteLine("The minimum is: {0}", min);
        Console.WriteLine("The maximum is: {0}", max);
        Console.ReadKey();
    }
  }
}

```

But minimum value is always 0, why is that?

Answer: 
Your issue is that you're initializing `min` and `max` to `numbers[0]` *before* numbers is populated, so they're both getting set to zero. This is wrong both for `min` (in case all your numbers are positive) and for `max` (in case all your numbers are negative).

If you move the block

```
int min = numbers[0];
int max = numbers[0];

```

to **after** the block

```
for (int i = 0; i < n; i++)
{
    Console.Write("Enter number {0}:  ", i+1);
    numbers[i] = Convert.ToInt32(Console.ReadLine());
}

```

then `min` and `max` will both be initialized to the first input number, which is fine. In fact you can then restrict your `for` loop to just check the subsequent numbers:

```
for (int i = 1; i < n; i++)
    ....

```

Just make sure the user's value of `n` is greater than zero!
You are initializing `min` to 0. 

Try following

```
int min = Int32.MaxValue;

```

Also In case you are accepting negative values as input, you should initialize max to minimum integer value.

```
int max = Int32.MinValue;

```