Important Notice:

Decimal to Binary Conversion

Decimal to Binary Conversion

4 views 1 min read

Decimal to Binary Conversion (दशमलव से बाइनरी रूपांतरण ) :- Question -

Write an algorithm and flowchart to convert a decimal number into its binary equivalent.

एक दशमलव संख्या को उसके बाइनरी समतुल्य में बदलने के लिए एक Algorithm और Flowchart लिखिए।

Example -

Decimal Number: 13
Binary Equivalent: 1101

Algorithm

  1. Start.
  2. Input a decimal number N.
  3. Set BINARY = 0 and PLACE = 1.
  4. Find the remainder: R = N % 2.
  5. Set BINARY = BINARY + (R × PLACE).
  6. Set N = N // 2.
  7. Set PLACE = PLACE × 10.
  8. If N > 0, repeat Steps 4 to 7.
  9. Display BINARY.
  10. Stop.

Example Logic -

13 ÷ 2 → Remainder 1
 6 ÷ 2 → Remainder 0
 3 ÷ 2 → Remainder 1
 1 ÷ 2 → Remainder 1

Flowchart :-

Related Notes