Write a program to display prime no. between given two no.

public class Prime
{
            public static void main(String arg[])
            {
                        int n,i,c=0;
                        int a =Integer.parseInt(arg[0]);
                        int b =Integer.parseInt(arg[1]);
                        for(int k =a;k<=b;k++)
                        {
                                    c =0;
                                    for(i=1;i<=k;i++)
                                    {
                                                n=k%i;
                                                if(n==0)
                                                {
                                                            c++;
                                                }
                                    }
                                    if(c == 2)
                                    {
                                                System.out.println(k);
                                    }
                        }
                                               
            }
}