A first semester Computer Science student who I am tutoring came to me with this problem and I am having great difficulty figuring it out, given the constraints of the assignment. Here it is:
Write a recursive C++ function of the form
int base_conv(unsigned short n,short r);
that accepts an integer n and converts it to base r, where r is an integer have the value 2,3,4,5,6,7,8, or 9.
The function must be recursive, and cannot use arrays, string, strings streams or any non standard functions. The solution must also be composed of C++ code comparable to what a first semester programming student would know.
Good luck...I'm stumped.