logo CodeStepByStep logo


Language/Type: C# recursion
Related Links:

Write a recursive method named PrintBinary that accepts an integer and prints that number's representation in binary (base 2). For example, the call of PrintBinary(43); should print 101011 .

If the integer is negative, print the binary representation preceded by a minus sign. For example, the call of PrintBinary(-6); should print -110 .

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.