+1 vote
in Class 12 by kratos

Write a program to convert decimal number to binary.

1 Answer

+3 votes
by kratos
 
Best answer

i=1

*=0

dec = int ( raw_input(“Enter the decimal to be converted:”))

while dec>0:

rem=dec%2

= + (i*rem)

dec=dec/2

i=i*10

print “The binary of the given number is:”,* raw_input()

...