Hi, I'm trying to figure out how to write some code to convert decimal to binary, octal, or hexadecimal. This has to be done using recursion.
Can anyone help me please?
Thanks.
Printable View
Hi, I'm trying to figure out how to write some code to convert decimal to binary, octal, or hexadecimal. This has to be done using recursion.
Can anyone help me please?
Thanks.
This is an example of recursion:
The rest should be simple enough, just Google it!Code:void myMethod( int counter)
{
if(counter == 0)
return;
else
{
System.out.println("hello" + counter);
myMethod(--counter);
System.out.println(""+counter);
return;
}
}