@ -120,6 +120,18 @@ int multiply_by_odd(int num, int factor) {
return result;
}
int multiply_using_binary_enumeration(int num1, int num2) {
int result = 0;
while (num1 && num2) {
if (num2 & 1) {
result += num1;
num1 <<= 1;
num2 >>= 1;
@ -19,6 +19,7 @@ int multiply_by_prime(int num, int prime);
int multiply_using_increment(int num1, int num2);
int multiply_by_prime_and_its_square(int num, int prime);
int multiply_by_odd(int num, int factor);
int multiply_using_binary_enumeration(int num1, int num2);
#endif // MULTIPLICATION_H