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

How do you find the perimeter of a dented square?
How do you find the perimeter of a dented square?
Suppose theta= 11pi/12. How do you use the sum identity to find the exact value of sin theta?
At the begining of 6 grade the ratio of number of the advanced math students to the number of regular students was 3:8. However after taking the placement tests
Suppose theta= 11pi/12. How do you use the sum identity to find the exact value of sin theta?
Suppose theta= 11pi/12. How do you use the sum identity to find the exact value of sin theta?
if arctan(3/5)=K    Tan(k)=?
At the begining of 6 grade the ratio of number of the advanced math students to the number of regular students was 3:8. However after taking the placement tests
What was an effect of nationalism in Europe in the early 1900s?
if arctan(3/5)=K    Tan(k)=?