Skip to content

Instantly share code, notes, and snippets.

@juanfal
Created December 2, 2012 20:29
Show Gist options
  • Save juanfal/4190912 to your computer and use it in GitHub Desktop.
Save juanfal/4190912 to your computer and use it in GitHub Desktop.
is prime?
bool isPrime(unsigned num)
{
int i = 2;
while (i < num and num % i != 0)
++i;
return i >= num;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment