Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created December 31, 2014 21:33
Show Gist options
  • Select an option

  • Save tylertreat/5f8056bcff2fa2061a33 to your computer and use it in GitHub Desktop.

Select an option

Save tylertreat/5f8056bcff2fa2061a33 to your computer and use it in GitHub Desktop.
public static boolean isPrime(int n) {
for (int i = 2; i < n - 1; i++) {
if (n % i == 0)
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment