Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool isPrime( int num ) {
- bool prime = true;// Assume it is a prime
- for ( int divisor = 2; divisor < num / 2; divisor++ )
- if ( num % divisor == 0 )
- prime = false;// Not a prime since it's dividable by something.
- return prime;// Return the result
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement