Browse Source

refactoring: added comments

remotes/origin/primzahl
Hendrik Sitzmann 11 months ago
parent
commit
fdc93983b5
  1. 3
      src/primzahl/primzahl.c

3
src/primzahl/primzahl.c

@ -2,12 +2,15 @@
#include <stdbool.h> #include <stdbool.h>
bool primzahl(int num) { bool primzahl(int num) {
//for the case zero or one
if (num <= 1) if (num <= 1)
return false; return false;
//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 false;
} }
//if none were found return true
return true; return true;
} }
Loading…
Cancel
Save