Check Given Number is Prime or Not
public class PrimeNum
{
public static void main(String args[])
{
int n=13,count=0;
for(int i=2;i<=n;i++)
{
if(n%i==0)
{
count=count+1;
}
}
if(count>=2)
System.out.println("not prime");
else
System.out.println("prime");
}
}
output: Prime