Results 1 to 2 of 2
  1. #1
    coco is offline Member
    Join Date
    Jul 2007
    Posts
    39
    Rep Power
    0

    Default Use recursion to convert binary to...

    Hi, I'm trying to figure out how to write some code to convert decimal to binary, octal, or hexadecimal. This has to be done using recursion.

    Can anyone help me please?

    Thanks.

  2. #2
    toby is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    This is an example of recursion:
    Java Code:
    void myMethod( int counter)
    {
    if(counter == 0)
    return;
    else
    {
    System.out.println("hello" + counter);
    myMethod(--counter);
    System.out.println(""+counter);
    return;
    }
    }
    The rest should be simple enough, just Google it!

Similar Threads

  1. convert a java binary/executable to a intermediate language
    By sumit_400461 in forum Advanced Java
    Replies: 1
    Last Post: 07-13-2008, 07:04 PM
  2. Help With Recursion
    By andrew777 in forum New To Java
    Replies: 1
    Last Post: 03-29-2008, 12:51 PM
  3. Recursion
    By bozovilla in forum Advanced Java
    Replies: 3
    Last Post: 01-07-2008, 04:53 PM
  4. recursion
    By ravian in forum New To Java
    Replies: 2
    Last Post: 12-03-2007, 05:15 PM
  5. Help with recursion
    By scts102 in forum New To Java
    Replies: 1
    Last Post: 11-19-2007, 10:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •