Question
To convert decimal number enetered by the user into its equivalent Binary number.
Answer :
Word Count : 277
__________ _________ _____ ____ _______.
___ _________ _________ _________ ___ ______ _________ __________ _______ ________ ______ ___.
_____ ___ ____ _______ ______ _______ _______ _________.
___ ________ ______ ________ ______ ________ __________ ________.
______ ___ _________ ____ __________ __________ ___ ___ ___ _________ _________ ________.
__________ ____ _________ _________ ______ _______.
___ ___ _____ ____ _________.
______ ______ _____ ______ _____ ________.
________ ___ _________ ___ _____ _______ _________ _________ ______.
_________ _____ ___ ________ _______ ___ _____ _______ ______ ___ ______.
_____ _______ ____ ___ ___ _______.
_________ ____ _____ ____ ______ ________ ____.
____ ________ ___ __________ _____.
_________ ________ ______ ________ __________ ______.
__________ __________ _______ ___ ________ ____ _______ _________ __________ ________ ___.
__________ _________ ________ ___ _________ _________ ___ ____ ______.
________ _________ __________ ____ _______ ____ ________ ________ ____ ________ ______ __________.
_________ ______ ____ ____ ________ ___ _______ __________ _______ _____ _______.
____ __________ _______ _________ ________.
____ ________ __________ ___ _____ _______ ____.
_________ _______ _______ __________ ___ ____.
_____ _____ ________ ______ _______.
Skip in 10
To convert a decimal number to its binary equivalent, you can use the following algorithm:
- Take the decimal number as input from the user.
- Divide the decimal number by 2, and note down the quotient and the remainder.
- Divide the quotient obtained in step 2 by 2, and again note down the quotient and remainder.
- Continue this process until the quotient becomes zero.
- The binary equivalent of the decimal number is obtained by arranging the remainders obtained in reverse order.
Here's a Python code example that implements this algorithm:
decimal_num = int(input("Enter a decimal number: "))
# initialize an empty list
___ _________ _________ _________ ___ ______ _________ __________ _______ ________ ______ ___.
_____ ___ ____ _______ ______ _______ _______ _________.
___ ________ ______ ________ ______ ________ __________ ________.
______ ___ _________ ____ __________ __________ ___ ___ ___ _________ _________ ________.
__________ ____ _________ _________ ______ _______.
___ ___ _____ ____ _________.
______ ______ _____ ______ _____ ________.
________ ___ _________ ___ _____ _______ _________ _________ ______.
_________ _____ ___ ________ _______ ___ _____ _______ ______ ___ ______.
_____ _______ ____ ___ ___ _______.
_________ ____ _____ ____ ______ ________ ____.
____ ________ ___ __________ _____.
_________ ________ ______ ________ __________ ______.
__________ __________ _______ ___ ________ ____ _______ _________ __________ ________ ___.
__________ _________ ________ ___ _________ _________ ___ ____ ______.
________ _________ __________ ____ _______ ____ ________ ________ ____ ________ ______ __________.
_________ ______ ____ ____ ________ ___ _______ __________ _______ _____ _______.
____ __________ _______ _________ ________.
____ ________ __________ ___ _____ _______ ____.
_________ _______ _______ __________ ___ ____.
_____ _____ ________ ______ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.