Answers for "c code to calculate multiplication using recursion"

0

c code to calculate multiplication using recursion

int multiply(int a, int b) {
    if (b > 0) {
        return a + multiply(a, b - 1);
    }
    else if (b < 0) {
        return -a + multiply(a, b + 1);
    }

    return 0;
}
Posted by: Guest on May-29-2021

Code answers related to "c code to calculate multiplication using recursion"

Browse Popular Code Answers by Language