title: C# - displaying the max, min, and average
body: <p>I am new to C#. I have been working on this program and researching but am not getting anywhere. The goal is to have the user enter numbers (how many is up to the user). when they enter a 0, it will stop the program and display the minimum number entered, the maximum number entered, and the average of all numbers entered. I am not getting any errors and I am getting. If someone can please point me in the right direction. </p>
  
  <p>The WriteLines are returning: </p>
  
  <p>Lowest number is 0
  Highest number is 0
  Average is: 0
  Count: 5</p>
  
  <p>Here is my code:</p>
  
  <pre><code>int LOWEST =0;
  int HIGHEST=0;
  const int STOP = 0;
  double average = 0;
  int input;
  
  int count = 0;
  Console.WriteLine("Enter a number. You can end the program at anytime by entering 0");
  input = Convert.ToInt32(Console.ReadLine());
  while (input != STOP)
  {
       for (int i=0; input != STOP; i++)
       {
             Console.WriteLine("Enter a number. You can end the program at anytime by entering 0");
             input = Convert.ToInt32(Console.ReadLine());
             count++;
             var Out = new int[] { input };
             LOWEST = Out.Min();
             HIGHEST = Out.Max();
             average = Out.Average();
  
             if ((input &gt; LOWEST) || (input &lt; HIGHEST))
             {
                   LOWEST = Out.Min();
  
             }
             if (input &gt; HIGHEST)
             {
                   HIGHEST = Out.Max();
             }
        }
  }
  
  
  Console.WriteLine("Lowest number is {0}", LOWEST);
  Console.WriteLine("Highest number is {0}", HIGHEST);
  Console.WriteLine("Average is {0}", average);
  Console.WriteLine("Count: {0}", count);
  Console.ReadLine();
  </code></pre>