public static int multiply2(int num1, int num2) {
if (num1 == 0 || num2 == 0) {
return 0;
}
else {
return num1 + multiply2(num1, num2 - 1);
}
}
I just realized that it would be fun to make a program that could determine the product of two numbers, one or both being negative. I want to do it using recursive multiplication (basically repeated addition). Could some one help me out? Thanks!
1 Answer