Bader N.
asked 04/25/161.Write an Algorithm , Flow chart , pseudo code to convert from decimal number system(base-10) to binary number system(base-2).
2 Answers By Expert Tutors
David W. answered 04/25/16
Experienced Prof
[A] The method Arnold F. proposed is very often taught:
Let m be the number, initially empty, that we are converting to. We'll be composing it right to left.
Let b be the base of the number we are converting to.
Repeat until n becomes 0
Divide n by b, letting the result be d and the remainder be r.
Write the remainder, r, as the leftmost digit of b.
Let d be the new value of n.
[B] Now, Computer Science and Math majors should realize that there is a recursive procedure for this:
Bader N.
step1: start
step2:
but I don't know how to write it to the end
please help me
04/25/16
David W.
Step 1: Let n be the decimal number.
Step 2: Let b be the number, initially 0, that becomes our answer. We'll be composing it right to left.
Step 3: Repeat until n becomes 0
Step 3a: Divide n by 2, letting the result be d and the remainder be r.
Step 3b: Append the remainder, r, as the leftmost digit of b.
Step 3c: Let d be the new value of n.
04/25/16
Arnold F. answered 04/25/16
College Professor & Expert Tutor In Statistics and Calculus
Bader N.
step1: start
step2:
but I don't know how to write it to the end
please help me
04/25/16
Arnold F.
04/25/16
Bader N.
04/25/16
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Bader N.
04/25/16