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

3. divide 15g^4/45g^3 A. 1/3g B. g/3 C. 3/g D. 3g Help please?
Brian is ordering books online. He has $100 to spend on the books. Each book costs $7. The shipping charge for the entire order is $8. The number of books, b, t
find the solution 2x+5y=12
Between which two integers does the negative square root of 41 lie?
What is the percent of increase from 30 to 54? Write your answer using a percent sign (%).
Determine whether the ordered pair (2, 13) is a solution of the equation y = 4x + 5. Explain what your answer (it being a solution, or not) tells you. In other
How do scientists use DNA to support evolution?
Which of the following is an example of indirect characterization? A. "Three times Della counted it. One dollar and eighty-seven cents. And the next day would
Sam needs to cut a piece of sheet metal into 8 pieces. It takes him 5minutes to make each cut. How many cuts will sam make?
Write this equation in slope intercept form 4x+2y=10