cacti
Closed Thread
Results 1 to 10 of 10

Thread: Decimal to binary converter help!

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    1
    The decimal (base ten) numeral system has ten possible values (0,*,2,*,4,5,6,7,8, or *) for each place-value. In contrast, the binary (base two) numeral system has two possible values, often represented as 0 or *, for each place-value.

    To avoid confusion while using different numeral systems, the base of each individual number may be specified by writing it as a subscript of the number. For example, the decimal number *56 may be written as *56*0 and read as "one hundred fifty-six, base ten". The binary number *00***00 may be specified as "base two" by writing it as *00***002.

    Since the binary system is the internal language of electronic computers, serious computer programmers should understand how to convert from decimal to binary. Although, converting in the opposite direction, from binary to decimal, is often easier to learn first.
    ________________________________________
    [url=http://www.housepaintermassachusetts.com]house painter massachsuetts[/url]
    [url=http://www.scottsdalelenderforeclosure.com]Scottsdale Foreclosures[/url]

  2. #2
    Join Date
    Jan 2010
    Posts
    1
    Hi guys,
    I'm sure this tool can help, I use it to make sure I'm converting the right way
    Use this [URL="http://www.stringfunction.com/decimal-binary.html"]decimal to binary converter[/URL]
    David

  3. #3
    Join Date
    Jan 2010
    Posts
    3
    Your problem is in the for. You're accessing indexes that haven't been given a value, and considering that an int that hasn't been given a value starts with a unpredictable number, it is printing that number.
    Change the for to:
    for( ; k>0 ; )
    printf("%d", b[--k]);
    Last edited by gordo; 01-25-2010 at 06:24 AM.

Closed Thread

Similar Threads

  1. The first Flip Converter in the world!
    By flipconverter in forum General discussion
    Replies: 1
    Last Post: 01-20-2010, 04:12 AM
  2. 2^*024 Decimal Precision
    By SyntaXmasteR in forum Programming
    Replies: 11
    Last Post: 05-21-2008, 05:53 PM
  3. IP to BINARY
    By SyntaXmasteR in forum Internet Privacy
    Replies: 0
    Last Post: 08-31-2005, 04:33 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