# Thread: Multiplication table using only recursion

1. ## Multiplication table using only recursion

I'v been asked to write the function that print the multiplication table until x*y using only recursion.
the function call will be mult(x,1,y);
void mult(int x, int base, int y).
Have any idea how to slove it?

2. The rule is as simple as this : You post your try and then you get feedback

3. My idea was : to print (x/x)*base each row
And then to promote base.

printf("%2d ",base);
if(base==y) return;
mult_table(x,++base,y);

my problem is when i stop recursion it back with base =5 and i didnt found how to use it.

4. Post your code in code tags next time, like this

I do not understand your problem :/

5. Ill.
My problem is to print each row after the first one .
I print the first row 1-10
but when the recursion is start to return it back with base 10 (in case 10*10) and i cant use that base to print the next row.
Have no idea how I need to make it.

6. Any problem which can be solved iteratively can also be solved using recursion. Why not make the iterative version first and then try to convert it to a recursive version?

for x = 1 to 10
for y = 1 to 10
...
end for
end for

7. I know , thank you