uwaismohammed46
uwaismohammed46 uwaismohammed46
  • 25-02-2021
  • Computers and Technology
contestada

write a python program to convert a number entered by the user
the input is 985
the output is Nine Eight Five

Respuesta :

ooo510125
ooo510125 ooo510125
  • 25-02-2021

Answer:

# Function to convert decimal number

# to binary using recursion

def DecimalToBinary(num):

if num >= 1:

DecimalToBinary(num // 2)

print(num % 2, end = '')

# Driver Code

if __name__ == '__main__':

# decimal value

dec_val = 24

# Calling function

DecimalToBinary(dec_val)

Explanation:

Answer Link

Otras preguntas

Who is the featured character in an earth diver story? A) a character who dives into water and brings up a small amount of mud or sand B) a character who travel
If a point inside the rectangle was chosen at random what is the probability that it is on the left side of the center line
what would be the federal government's biggest problem if a war was imminent?
Which sentence does not contain any errors in comma usage? A.The artist paints landscapes and animals and then she sells her artwork at the outdoor market. B.Ma
What is the difference between: heiße and heißt Das and die
There were 70 runners to start a race. In the first half of the race, 1/5 of them dropped out. In the second half of the race, 4/7 of the remaining runne
what force helps a ship float?
Describe how metal bars are used in candy-making.
what is the point of view of excerpt from mr.revere and I
Which leader of the Mughal Empire was very curious, but illiterate, and displayed religious tolerance to the extent that he took one wife from every of the four