title: Find largest, smallest, positive and negative
body: <p>I wrote this code and I want it to find the count of numbers that are negative, smallest number, largest number, average of the numbers, and sum of the number</p>
  
  <p>It's not working, Could you help me using <code>if</code> statement? I can't find the smallest or largest (when numbers are negative) + can't find if all of numbers were negative or positive or mix. </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void main() {
      float num,
          average,
          sum,
          smallest,
          largest,
          positive,
          negative;
  
      int count;
      sum = 0;
      count = 1;
      largest = 0;
      smallest = 0;
      negative = 0;
  
      while (count &lt; 11) {
          cout &lt;&lt; "Number #" &lt;&lt; count &lt;&lt; ": ";
          cin &gt;&gt; num;
  
          if (num &lt; 0) negative++;
  
          sum += num;
          average = (sum / 10);
  
          if (num &gt; largest) largest = num;
          else if (num &lt; smallest) smallest = num;
  
          count++;
      }
  
      cout &lt;&lt; endl &lt;&lt; "The smallest number is " &lt;&lt; smallest &lt;&lt; endl;
      cout &lt;&lt; "The largest number is " &lt;&lt; largest &lt;&lt; endl;
      cout &lt;&lt; "The average of all numbers is " &lt;&lt; average &lt;&lt; endl;
      cout &lt;&lt; "The sum of all numbers is " &lt;&lt; sum &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "There are " &lt;&lt; negative &lt;&lt; " negative numbers." &lt;&lt; endl;
  
  
      if (num &gt; 0) cout &lt;&lt; "All numbers are positive.";
      else if (sum &lt; 0) cout &lt;&lt; "All numbers are negative.";
      else if {
          cout &lt;&lt; "There is a mixture of numbers.";
      }
  }
  </code></pre>
  
  <p>//------------------------------------
  <strong>EDIT</strong></p>
  
  <p>I've made some changes and I almost got right, but I still can't find a way to find the smallest and largest </p>
  
  <pre><code>using namespace std;
  
  void main()
  {
  
  float num,
  average,
  sum,
  largest,
  smallest,
  positive,
  negative;
  
  int count;
  sum = 0;
  count = 1;
  negative = 0;
  
  largest= 0;
  smallest = 0;
  
  while ( count &lt; 11)
  {
    cout &lt;&lt; "Number #" &lt;&lt; count &lt;&lt; ": ";
    cin &gt;&gt; num;
  
    if ( num &lt; 0 )negative++;
  
    sum += num;
  
    if (count != 0 )
    {
       if ( num &gt; largest )
          largest = num;
       else if ( num &lt; smallest )
          smallest = num;
    }
  
    count++;
  } 
  
  average = ( sum / 10 );
  
  
  cout &lt;&lt; endl &lt;&lt; "The smallest number is " &lt;&lt; smallest &lt;&lt; endl;
  cout &lt;&lt; "The largest number is " &lt;&lt; largest &lt;&lt; endl;
  cout &lt;&lt; "The average of all numbers is " &lt;&lt; average &lt;&lt; endl;
  cout &lt;&lt; "The sum of all numbers is " &lt;&lt; sum &lt;&lt; endl;
  cout &lt;&lt; endl;
  cout &lt;&lt; "There are " &lt;&lt; negative &lt;&lt; " negative numbers." &lt;&lt; endl;
  
   if ( negative == 0 )
      cout &lt;&lt; "All numbers are positive.";
   else if ( negative == 10 )
      cout &lt;&lt; "All numbers are negative.";
   else 
   {
      cout &lt;&lt; "There is a mixture of numbers.";
   }
  }
  </code></pre>