Skip to content

Instantly share code, notes, and snippets.

@Nata01
Created December 15, 2015 12:19
Show Gist options
  • Save Nata01/dacb2ae1411586799739 to your computer and use it in GitHub Desktop.
Save Nata01/dacb2ae1411586799739 to your computer and use it in GitHub Desktop.
Prime numbers
bool isPrime(int number){
for(int i = 2; i <= sqrt((double)number); i++){
if(number%i == 0)
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment