title: Prime Numbers in a given range without using flag
body: <p>I am New To Programming in Java.
  I want to print prime numbers in a given range.
  I know that flag method but i want to try something else.</p>
  
  <p>i worked on this method .</p>
  
  <p>/**
   *
   * @author Mridul
   */
  public class JavaApplication23 {</p>
  
  <pre><code>/**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
      // TODO code application logic here
      int x1=2;
      int x2=89;
  
      for(int i=x1;i&lt;x2;i++)
      {
          for(int j=2;j&lt;i;j++)
          {
              if(i%j==0)
              {
                  break;
              }
              System.out.println(i);
  
  
          }
  
      }
  }
  }
  </code></pre>
  
  <p>Its not giving me the desired result.
  Can anybody edit this code so i can get the result 
  Please dont use any new variable, just edit this code.</p>