Skip to content

Instantly share code, notes, and snippets.

@viveknarang
Created September 29, 2017 01:48
Show Gist options
  • Save viveknarang/e720090cdad9a2267b95280c07d05464 to your computer and use it in GitHub Desktop.
Save viveknarang/e720090cdad9a2267b95280c07d05464 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class InsectGrowth {
public static void main (String [] args) {
int numInsects = 0;
numInsects = 8; // Must be >= 1
while(numInsects < 100) {
System.out.print(numInsects + " ");
numInsects += numInsects;
}
System.out.println("");
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment