unassigned variable occured when compiling
<p>This piece of code was written to generates 100 random numbers between 0 and 1000 and display the number of even values generated as well as the smallest, the largest, and the range of values. </p>

<p>When I compile I'm getting an error about using unassigned local varibale of minInt and maxInt. It is supposed to get assigned variable from the generator, what did I do wrong?</p>

<pre><code>using System;
using System.Windows.Forms;

namespace ConsoleApplication27
{
    class Program
    {
        static void Main(string[] args)
        {
            int evenNumbers = 0;
            int minInt;
            int maxInt;
            int range;
            string result;

            range = maxInt - minInt;

            result = "Even numbers:\t" + evenNumbers;
            result += "\nMin number:\t" + minInt;
            result += "\nMax number:\t" + maxInt;
            result += "\nRange of number:\t" + maxInt + " - " + minInt + " = " + range;

            DisplayResults(result);
        }

        static void GenerateNumbers(int evenNumbers,  int minInt,  int maxInt,  int range)
        {
            //creating 100 element array
            //and using the random function to fill it
            int[] randomNumbers = new int[100];
            Random number = new Random();
            int randy;
            for (int i = 0; i &lt; randomNumbers.Length; i++)
            {
                randy = number.Next(1000);
                randomNumbers[i] = randy;
                if (randy &lt; minInt)
                {
                    minInt = randy;
                }
                else
                    if (randy &gt; maxInt)
                    {
                        maxInt = randy;
                    }
                if (randomNumbers[i] % 2 == 0)
                {
                    evenNumbers++;
                }
            }
        }
        static void DisplayResults(string outcome)
        {
            MessageBox.Show(
            outcome, "results!",
            MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}
</code></pre>
