SimpleDis
SimpleDis SimpleDis
  • 12-03-2016
  • Computers and Technology
contestada

Algorithm for converting decimal into binary.

Respuesta :

Аноним Аноним
  • 12-03-2016
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
Answer Link

Otras preguntas

What are the like terms of 8c - 12 - 5c +4
The sum of three consecutive positive integers is a perfect cube. find the least possible value of the smallest number, assuming that the middle number ends in
Find the value of z.
A trait has two alleles, which are represented by p and q. If p = 0.44, what is q?
What part of the visible light spectrum produces the most light?
Lebron scored a basket 72 times out of 150 shots. what percent of his shots did he score? a. 42% b. 50% c. 48% d. 63%
Find the number of ways to purchase 5 different kinds of drinks from a selection of 13 drinks.
find the 16th term of the series 7+2-3-8-13-•••••••••
Which nonnutritive sweetener should be entirely avoided by individuals with phenylketonuria (pku)?
How much work does the up escalator do on you when you ride it from the lower level to the upper level?