Skip to content

Instantly share code, notes, and snippets.

@otarza
Created November 4, 2012 07:01
Show Gist options
  • Save otarza/4010687 to your computer and use it in GitHub Desktop.
Save otarza/4010687 to your computer and use it in GitHub Desktop.
isPrime
private boolean IsPrime(int n) {
int f = n-1;
while(f!=1) {
int k=n%f;
f=f-1;
if(k==0) {
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment