|
@ -1,16 +1,15 @@ |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
|
|
|
|
bool primzahl(int num) { |
|
|
|
|
|
|
|
|
int primzahl(int num) { |
|
|
//for the case zero or one |
|
|
//for the case zero or one |
|
|
if (num <= 1) |
|
|
if (num <= 1) |
|
|
return false; |
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
//checking if there are any other divider |
|
|
//checking if there are any other divider |
|
|
for (int i = 2; i < num; i++) { |
|
|
for (int i = 2; i < num; i++) { |
|
|
if (num % i == 0) |
|
|
if (num % i == 0) |
|
|
return false; |
|
|
|
|
|
|
|
|
return 0; |
|
|
} |
|
|
} |
|
|
//if none were found return true |
|
|
//if none were found return true |
|
|
return true; |
|
|
|
|
|
|
|
|
return 1; |
|
|
} |
|
|
} |