Without using any loops, I need to create a function that will use recursion to print all the multiples of a given number up to any limit given (the limit will be given to the function by the programmer). e.g. given 7, will print 7, 14, 21, 28...(until the end)
Here is the code I have:
the problem is when I run the code the program only outputs the next number and not the original number or the numbers leading up to the number I want the program to end at.
int a, b, c;
printf("Enter in an integer and a number you wish to stop at:\n");
scanf("%d%d", &a, &b);
c = a;
c < b;
c += a;
printf("Your numbers are: %d.\n", c);
Any help would be greatly appreciated.