Please specify which language in Relevant Tags to clarify scope of the question.
I would suggest you to search the Code Playground for 'base converter' search keyword, other people had done that, and you can learn from their code, how it is done.
Please edit your original question above, and put C++ into the Relevant Tags section. I already did search Code Playground with 'base converter' keyword before I suggested you, and I found many codes in search result.
Which programming language do you prefer?
One approach which will work in almost any language is to use integer for the value and an array for digits.
To convert from decimal simply make a loop with modulo operator. To read input in different number system use a loop with multiplication of the exponent inside.
If you use c++ you can use itoa to convert integers to string with arbitrary base.