Browse Source

added function to primzahl.c

remotes/origin/primzahl
Hendrik Sitzmann 11 months ago
parent
commit
763a29f6aa
  1. 13
      src/primzahl/primzahl.c

13
src/primzahl/primzahl.c

@ -0,0 +1,13 @@
#include <stdio.h>
#include <stdbool.h>
bool primzahl(int num) {
if (num <= 1)
return false;
for (int i = 2; i < num; i++) {
if (num % i == 0)
return false;
}
return true;
}
Loading…
Cancel
Save