write a recursive function to convert a number in decimal to a given base b, where b is between 2 and 36.
so far converts between 2 and 16 what must be added to convert between 2 and 36?
#include <iostream>
using namespace std;
void toBase(int n, int base)
{
string alpha="0123456789ABCDEF";
if (n > 0)
{
toBase(n/base,base);
cout << alpha[n%base];
}
}
main()
{
int num, b;
cout << "Input number and the Base to Convert it to: ";
cin >> num >> b;
cout << endl << num << " in base 10 is ";
toBase(num,b);
cout << " in base " << b << endl;
}
<< moderator edit: added [code][/code] tags >>