@ -0,0 +1,19 @@
#include "calculateFactorial.h"
int calculateFactorial_integer(int n) {
if (n < 0) {
} else if (n == 0 || n == 1) {
return 1;
} else {
int result = 1;
for (int i = 2; i <= n; ++i) {
result *= i;
}
return result;
@ -0,0 +1,8 @@
#ifndef THEADMIRALS_CALCULATEFACTORIAL_H
#define THEADMIRALS_CALCULATEFACTORIAL_H
int calculateFactorial_integer(int n);
#endif //THEADMIRALS_CALCULATEFACTORIAL_H