Ask Question
2 November, 09:04

Algorithm for converting decimal into binary.

+1
Answers (1)
  1. 2 November, 11:12
    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?
Get an answer to your question ✅ “Algorithm for converting decimal into binary. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers