Monday, May 17, 2010

Decimal to Binary recursive method for Java [closed]

Programmer Question

Write a recursive method that converts a decimal number into a binary number as a string. The method header is as follows: public static String convertDecimalToBinary(int value)



This is what I have so far:



public static String convertDecimalToBinary(int value) {
if (value == 0)
return

convertDecimalToBinary(value / 2) + temp;
}


Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails