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>
bool primzahl(int num) {
//for the case zero or one
if (num <= 1)
return false;
//checking if there are any other divider
for (int i = 2; i < num; i++) {
if (num % i == 0)
return false;
}
//if none were found return true
return true;
}
Loading…
Cancel
Save