title: find prime numbers between two numbers
body: <p>I want to find prime numbers between two numbers that we get from the inputs, but I get this error:</p>
  <blockquote>
  <p>num cannot be resolved to a variable</p>
  </blockquote>
  <p>I read the code many times but couldn't find the problem!<br />
  Can you help me?</p>
  <pre><code>public class PrimeNumbers {
      public static void main(String[] args) {
          Scanner input1 = new Scanner(System.in);
          System.out.print(&quot;Enter Start number: &quot;);
          int number1 = input1.nextInt();
          Scanner input2 = new Scanner(System.in);
          System.out.print(&quot;Enter End number: &quot;);
          int number2 = input2.nextInt();
          input1.close();
          input2.close();
          int counter = 0;
          for (int num=number1; num&lt;number2; num++)
              if (number1&lt;2 || number2&lt;2 || number2&lt;number1)
                  break;
              else if (isPrime(num))
                  counter++;
                  System.out.println(num);
          System.out.println(&quot;Total Prime Numbers Between &quot; + number1 + &quot; and &quot; + number2 + &quot; =&gt; &quot; + counter);
      }
      
      static boolean isPrime(int number) { 
          if (number&lt;2)
              return false;
          for (int i=number; i&lt;number; i++)
              if (number%i==0)
                  return false;
          return true; 
      }
  }
  </code></pre>