Question: So, for my assignment, I'm supposed to code a function that takes 2 unsigned arguments and outputs their product. 

```
unsigned multiply( unsigned a, unsigned b );

```

For instance,

```
multiply(3, 4)

```

should return 12

The thing is, I'm not allowed to use +, -, /, \*, or % operators. I'm only allowed to call functions, and increment/decrement with ++ and --.

I have another function already made to add 2 arguments:

```
unsigned add(unsigned a, unsigned b)
{
    if (a > 0)
        add(--a, ++b);
    else return(b);
}

```

and I'm allowed to call this, along with any helper functions I need.

I've spent the past 30 minutes trying out various permutations but I just cannot get the math right; the closest I've come is getting b to double itself a times, but that's not going to cut it. Any ideas?

Edit: Forgot to mention! For/while loops aren't allowed either

Answer: 
```
int multiply (int a, int b) 
{
    int result = 0;
    for (int i = 0; i < a; i++) { //You repeat "a" times...
        for (int j = 0; j < b; j++) { //...adding "b" to result.
            result++;
        }
    }
    return result;
}

```

Of course if recursivity is mandatory, this won't works.
i didn't compile it but i`m sure its working

```
mutiply(3, 4, 0)

int mutiply(int a, int b, int result) {
  if(a > 0) {
    for(int i=1;i<=b;i++)
      result++
    mutiply(--a, b, result);
  } else return (result == 0 && a == 0) ? 0 : result;
}

```