logo CodeStepByStep logo

PrintBinary

Language/Type: VB recursion

Write a recursive subroutine 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 .

Function: Write a VB function as described, not a complete program.

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.