import javax.swing.*;
class prime2
{    	     
      public static void main(String args[])
      {    
           int n1=Integer.parseInt(JOptionPane.showInputDialog("enter first number  : "));
           int n2=Integer.parseInt(JOptionPane.showInputDialog("enter second number : "));
           int i,j;
           String s=" ";
           for(i=n1;i<=n2;i++)
           {for(j=2;j<i;j++) {if(i%j==0) {break;}}
           if(i==j) {s+=i+"\n";}
           }           
           JOptionPane.showMessageDialog(null,s,"Prime numbers between "+n1+" and "+n2,JOptionPane.PLAIN_MESSAGE);         
     }
 }
