title: How to count max, min and avg values of a list of input from a user
body: <p>guys! I have a midterm next week for c++ and I was given a few exercises to work on. For this one, I'm stumped on how to get the minimum and average values from a list of integers the user inputs. Any help would be well appreciated! :)</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      int max = 0;
      int min = 0;
      int num = 0;
      cout &lt;&lt; "Enter a list of integers terminated by a negative number: " &lt;&lt; endl;
  
  
      while(cin &gt;&gt; num)
      {
          if(num &gt;= 0)
          {
              if (num &gt; max)
              {
                  max = num;
              }
              if (num &lt; max)
              {
  
              }
          }
      }
  
      return 0;
  }
  </code></pre>