title: Problem with C program not exiting at integer count 150 by using a while loop
body: <p>I was wondering if I could get some help with a problem that I am having.</p>
  <p>Basically, I am trying to end my program by using a while loop when the people count gets to 150.</p>
  <p>My math seems to be right, but for some reason, the program ends when it gets to people count 276.</p>
  <p>Can anyone help with this issue? Thanks!</p>
  <p>Code Input:</p>
  <pre class="lang-c prettyprint-override"><code>int main () { 
      // declare variables
      int weeks=0, people=5;
      while (people &lt; 150) {
          weeks++;
          people=(people-weeks)*2;
          printf(&quot;On week %d Professor Rabnud's Social Media Group has %d people\n&quot;, weeks, people);
      } 
      // end program
      return 0; 
  }
  </code></pre>
  <p>Code Output:</p>
  <pre><code>On week 1 Professor Rabnud's Social Media Group has 8 people
  On week 2 Professor Rabnud's Social Media Group has 12 people
  On week 3 Professor Rabnud's Social Media Group has 18 people
  On week 4 Professor Rabnud's Social Media Group has 28 people
  On week 5 Professor Rabnud's Social Media Group has 46 people
  On week 6 Professor Rabnud's Social Media Group has 80 people
  On week 7 Professor Rabnud's Social Media Group has 146 people
  On week 8 Professor Rabnud's Social Media Group has 276 people
  </code></pre>