Skip to content

Instantly share code, notes, and snippets.

@greenboxal
Forked from anonymous/gist:5282869
Last active December 15, 2015 15:38
Show Gist options
  • Save greenboxal/5282877 to your computer and use it in GitHub Desktop.
Save greenboxal/5282877 to your computer and use it in GitHub Desktop.
bool isPrime(int n)
{
int max = (int)sqrt(n);
for (int j = 2; j < max; j++)
if (n % j == 0)
return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment