Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool isPrime(int num) {
- for (int i = 2; i < num; i++) {
- for (int j = 0; j < num; j++) {
- if (i*j == num) {
- return false;
- }
- }
- }
- if (num == 1) {
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement