diff --git a/src/main/c/Calculator/calculator.c b/src/main/c/Calculator/calculator.c index 1ddf5fe..8d4cdc8 100644 --- a/src/main/c/Calculator/calculator.c +++ b/src/main/c/Calculator/calculator.c @@ -121,6 +121,13 @@ double getDoubleInput(const char *message) { scanf("%lf", &input); return input; } +double factorial(double num) { + if (num == 0) { + return 1; + } else { + return num * factorial(num - 1); + } +} int getIntInput(const char *message) { int input;