Ask Question

Algorithm for converting decimal into binary.

+1
Answers (1)
  1. 13 December, 03:26
    0
    The simplest way is to make for loop first you need to generate 1,2,4,8,16,32,64,128,256 ... and others number in Array. Then you will check every number. Like this.

    Decimal Input 84;

    64 is closest to 84.

    84-64=20

    Write: 1

    20-32=-12 (Because It's negative you will write 0)

    Write:10

    20-16=4

    Write: 101

    4-8=-4 (Negative)

    Write:1010

    4-4=0

    Write: 10101

    0-2=-2

    0-1=-1

    Write: 1010100 = 84
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Algorithm for converting decimal into binary. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers