title: Expected ; before ) token error in C
body: <p>I'm trying to figure out a homework assignment in C. I'm supposed to have the user enter integers until they enter a negative number. At that point the program needs to stop inputting and proceed to output the sum, number of tries before a negative number is entered, and the mean. </p>
  
  <p>I can't seem to find any errors in my code (although I'm sure there is), but when I try to compile I get multiple errors on my output <code>printf</code> statements that say both <code>expected ';' before ')' token</code> and <code>expected statement before ')' token</code>. I must be blind. Please enlighten me. </p>
  
  <p>Here's all my code thus far:</p>
  
  <pre><code>int main(void)
  {
      int i=0,sum=0,tries=0;
      int mean=sum/tries;
      do
      {
          printf("Please enter a number %i. When finished, enter "
              "a negative number. \n",i);
          scanf("%i",&amp;i); 
          sum+=i;
          tries++;
      }
      while(i&gt;=-1);
  
      if((sum&lt;=0) &amp;&amp; (i&lt;=-1))
      {
          printf("No valid numbers were entered. Try again. ");
      }
      else
      {
          printf("Sum is %i\n"),sum);
          printf("%i tries \n"),tries);
          printf("Mean is %i \n"),mean);
  
      }
  
       return 0;
  }
  </code></pre>