title: Java While Loops
body: <p>I am working on a while loop that I would like to stop while the variable is less than 100. With what I have currently, my output stops at 128 - not sure why it prints 128 when the last output should be 64.  Any pointers?</p>
  
  <pre><code>import java.util.Scanner;
  
  public class InsectGrowth {
  public static void main (String [] args) {
    int numInsects = 0;
  
    numInsects = 8; 
  
    System.out.print(numInsects + " ");
  
    while (numInsects &lt; 100) {
       numInsects = numInsects * 2;
       System.out.print(numInsects + " ");
    }
  
    System.out.println();
  
    return;
    }
  }
  </code></pre>