Wednesday, 12 September 2012

Prime

public
class Prime {
public static boolean CheckPrime(int a)
{
boolean test=true;
for(int i=2;i<a/2;i++)
{
if(a%i==0){
test=
false;break;
}
}
return test;
}
public static void main(String[] args) {
System.
out.print (CheckPrime(17)) ;
}
}

No comments:

Post a Comment