Browse Source

added termination condition in function

remotes/origin/fakultaet
Hendrik Sitzmann 11 months ago
parent
commit
69ed4f6651
  1. 5
      src/fakultaet/fakultaet.c

5
src/fakultaet/fakultaet.c

@ -1,6 +1,11 @@
#include <stdio.h>
int fakultaet(int n) {
if (n < 0) {
printf("Fakultaet kann nicht für negative Zahlen berechnet werden!\n");
return -1;
}
if (n == 0 || n == 1)
return 1;

Loading…
Cancel
Save