an algorithm to convert a decimal number to its binary equivalent. Urgent!
Answers
Answer:
The answer is an algorithm called “ Divide by 2 ” that uses a stack to keep track of the digits for the binary result. The Divide by 2 algorithm assumes that we start with an integer greater than 0. A simple iteration then continually divides the decimal number by 2 and keeps track of the remainder.
An easy method of converting decimal to binary number equivalents is to write down the decimal number and to continually divide-by-2 (two) to give a result and a remainder of either a “1” or a “0” until the final result equals zero.Divide by 2 ” that uses a stack to keep track of the digits for the binary result. The Divide by 2 algorithm assumes that we start with an integer greater than 0. A simple iteration then continually divides the decimal number by 2 and keeps track of the remainder.
HOPE IT HELPS...
STAY HOME STAY HEALTHY...