Skip to content

Instantly share code, notes, and snippets.

@lnsp
Created November 10, 2014 16:55
Show Gist options
  • Save lnsp/c1be41e0a4d03ce4b010 to your computer and use it in GitHub Desktop.
Save lnsp/c1be41e0a4d03ce4b010 to your computer and use it in GitHub Desktop.
Tests if a given number is a prime number
bool isPrimeNumber(const int n) {
for (int i = 2; i < n; 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