I am looking for some brief explanations on how the below program or code works.Thanks
public void Convert( int iNum )
{
int m = 0;
if (iNum == 1 )
System.out.print( iNum );
else
{
m = iNum % 2;
Convert(iNum/2);
System.out.print(m);
}
}
This program tries to convert a decimal number to binary using recursion. Lets take an example:
Decimal 5 -> Binary 101