title: Calculating average of all user input numbers using while loops in C#
body: <p>I'm trying to work through a problem presented in one of my classes. The prompt is telling us to get the user to enter any numbers (can be positive, negative, or 0), while ignoring non-numeric inputs. Then we need to compute and display the average of all the numbers entered by the user. If the user doesn't give any numbers, I need to output &quot;you didn't enter any numbers&quot;.</p>
  <p>My main issue is that I'm not able to store and add the numbers given by the user properly. I'm fairly certain that everything before and after the while statement is sound. So, I know the issue must lie within <code>while (enter!=&quot;Yes&quot;||enter!=&quot;yes&quot;||enter!=&quot;Y&quot;||enter!=&quot;y&quot;)</code>, but I'm not exactly sure what the issue is. Since I have variables for my average, the sum of the user given numbers, and a counter to keep track of loop iterations, I'm pretty sure my troubles are coming from my code not being in the correct order.</p>
  <pre><code>Console.WriteLine(&quot;Please enter any numbers, then type Yes to continue.&quot;);
          string enter = Console.ReadLine();
          string msg = &quot;&quot;;
          decimal average;
          int counter = 0;
          decimal sum = 0;
          bool res = decimal.TryParse(enter, out average);
          while (enter!=&quot;Yes&quot;||enter!=&quot;yes&quot;||enter!=&quot;Y&quot;||enter!=&quot;y&quot;)
          {
              sum = decimal.Parse(enter);
              Console.WriteLine(&quot;Please enter any numbers, then type Yes to continue&quot;);
              enter = Console.ReadLine();
              sum += counter;
              counter++;
          }
          average = sum / counter;
          msg = (res) ? $&quot;The sum of your numbers is {average}&quot; : &quot;You didn't enter any numbers&quot;;
          Console.WriteLine(msg);
  </code></pre>