From 33def303b403c06e98917302152d42aba2a4ee83 Mon Sep 17 00:00:00 2001 From: Hendrik Sitzmann Date: Thu, 8 Feb 2024 05:39:38 +0100 Subject: [PATCH] refactoring: added function comments --- src/fakultaet/fakultaet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fakultaet/fakultaet.c b/src/fakultaet/fakultaet.c index 93273f6..b05b947 100644 --- a/src/fakultaet/fakultaet.c +++ b/src/fakultaet/fakultaet.c @@ -1,9 +1,11 @@ #include int fakultaet(int n) { + // Checking if the input is either zero or one if (n == 0 || n == 1) return 1; + // The result multiplies with i and i increases every turn until the loop ends int result = 1; for (int i = 2; i <= n; i++) { result *= i;