title: I need the loop to stop once 5 unique integers are entered into the list. The program runs but it does not stop when the unique numbers are entered
body: <pre><code>public void UniqueNumbers()
  {
    List&lt;int&gt; valueList = new List&lt;int&gt;(); 
    int ListInput;
    var distinctCount = 0;
    
    while (distinctCount != 5) 
    {
      Console.WriteLine(&quot;Please enter an integer value: &quot;);
      string? val = Console.ReadLine();
      ListInput = Convert.ToInt32(val);
  
      if (ListInput &lt; 0 || ListInput &gt; 100) 
      {
        valueList.Add(ListInput);
      }
  
      distinctCount = valueList.Distinct().Count();
    }
  }
  </code></pre>
  <p>The integers would be placed in the list. Once the 5 unique numbers have been entered by the user, the loop should end. The if statement is to not allow numbers less than 0 or numbers greater than 100. The user will enter as many numbers as they need until 5 unique numbers are entered.</p>