diff --git a/src/multiplication.c b/src/multiplication.c index f2ddf1c..455175f 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -236,6 +236,15 @@ int karatsu_multi(int num1, int num2) { } +int multiplication_repetition(int a, int n) { + int resultat = 0; + for (int i = 0; i < n; i++) { + resultat += a; + } + return resultat; +} + + diff --git a/src/multiplication.h b/src/multiplication.h index 52fdcf4..52e2641 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -31,6 +31,7 @@ int bernoulli_multi(int num, int bernoulli); float power_multi(float base, int exponent); int bitwisee_multi(int num1, int num2); int karatsu_multi(int num1, int num2); +int multiplication_repetition(int a, int n);