diff --git a/src/fakultaet.c b/src/fakultaet.c index e057620..46d9f0f 100644 --- a/src/fakultaet.c +++ b/src/fakultaet.c @@ -12,6 +12,14 @@ int berechneFakultaetInt(int zahl) { } } -double berechneFakultaetDouble(double a, double b) { - return 0; +int berechneFakultaetDouble(double zahl) { + if (zahl == 0 || zahl == 1) { + return 1; + } else { + double fakultaet = 1; + for (double i = 2; i <= zahl; ++i) { + fakultaet *= i; + } + return fakultaet; + } }