Ask Question
9 July, 08:19

Algorithm for converting decimal into binary.

+4
Answers (1)
  1. 9 July, 08:24
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers