diff --git a/src/multiplication.c b/src/multiplication.c index 0bb5f0e..cef7c1c 100644 --- a/src/multiplication.c +++ b/src/multiplication.c @@ -28,6 +28,11 @@ float multiply_by_percentage(float num, float percentage) { return num * (percentage / 100); } +int multiply_by_random(int num) { + int random_factor = rand() % 10 + 1; + return num * random_factor; +} + diff --git a/src/multiplication.h b/src/multiplication.h index 9f09f48..894f020 100644 --- a/src/multiplication.h +++ b/src/multiplication.h @@ -7,5 +7,7 @@ int multiply_left_shift(int a, int b); int multiply_right_shift(int a, int b); int multiply_by_ten(int a); float multiply_by_percentage(float num, float percentage); +int multiply_by_random(int num); + #endif // MULTIPLICATION_H