Problem:
Write a method that converts from Decimal to Binary using Recursion in Java.
Output:
Not applicable.
Solution:
public static void convert(int number)
{
if (number > 0)
{
convert(number / 2);
System.out.print(number % 2);
}
}
No comments :
Post a Comment