@ -159,9 +159,23 @@ int multiply_octal_numbers(int num1, int num2) {
num1 <<= 3; // Décalage octal
num2 >>= 1;
}
return result;
int multiply_hex_numbers(int num1, int num2) {
int result = 0;
while (num2 != 0) {
if (num2 & 1) {
result += num1;
num1 <<= 4; // Décalage hexadécimal
@ -23,6 +23,7 @@ int multiply_using_binary_enumeration(int num1, int num2);
int multiply_using_differences(int num1, int num2);
int multiply_recursive_optimized(int num1, int num2);
int multiply_octal_numbers(int num1, int num2);
int multiply_hex_numbers(int num1, int num2);
#endif // MULTIPLICATION_H