Ok i have to make a program that takes a decimal integer and converts it to either binary, octal, or hexidemimal.. And i need help on how the conversoin part of all 3 of them.

All i have for all three of them is

while (input != 0) {

Oh, and we cant use the java pre-defined conversions that are in the library, we have to do the conversions by hand.

Can somebody please help me?
Thanks in advance. :)