title: Use Modulus Operator to Get Prime Numbers
body: <p>How would you modify the below to print out all prime numbers from 1-100?  The below has an issue with the number 2 coming back as not prime.  The if(i%number == 0) condition is met for the number 2 as 2%2 is returned as 0. </p>
  
  <pre><code>public class Test {
  
      /**
       * @param args
       */
      public static void main(String[] args) {
          for(int i=1; i&lt;=100; i++){
              if(isPrime(i)){
                  System.out.println(i + " is a prime number");
              }else{
                  System.out.println(i + " is not a prime number");
              }
          }
  
      }
      public static boolean isPrime(int number){
          for(int i=2; i&lt;=number; i++){
  
              if(i%number == 0){
                  return false;
              }else{
                  return true;
              }
          }
          return false;
      }
  
  }
  </code></pre>