title: Check whether the number is divisible by both 3 and 7, or by neither of them
body: <p>Got my head in spaghetti mode.</p>
  
  <p>Here is the question:</p>
  
  <p>(Check a number) Write a program that prompts the user to enter an integer and checks whether the number is divisible by both 3 and 7, or by neither of them, or by just one of them. Here are some sample runs for inputs, 9,21, and 25.</p>
  
  <p>9 is divisible by 3 or 7, but not both
  21 is divisible by both 3 and 7
  25 is not divisible by either 3 or 7/</p>
  
  <p>This is what I have so far. I know I'm wrong but do not think I am too far from solving the question.</p>
  
  <pre><code>public class Quest12 {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
  
          Scanner scan = new Scanner(System.in);
          System.out.println("Enter a number: ");
          int i = scan.nextInt();
  
          if (i % 3 == 0 ^ 7 == 0) {
              System.out.println(i + " is divisible by 3 or 7. ");
          } 
          else if (i % 3 == 0 || 7 == 0)
          {
             System.out.println(i + " is divisble by either 3 or 7. but not both "); 
          }
          if (i % 3 == 0 &amp;&amp; 7 == 0)
          {
              System.out.println(i + " is divisble by both 3 and 7 ");
          }
      }
  }
  </code></pre>