Answer:
In Python:
num = int(input("Enter a decimal integer: "))
temp = num
bin = ""
while num > 0:
bin = str(num%2)+bin
num//=2
print(str(temp)+" in binary is "+str(bin))
Explanation:
This prompts the user for a decimal number
num = int(input("Enter a decimal integer: "))
This assigns the input number to a temporary variable
temp = num
This initializes the binary output to an empty string
bin = ""
This loop is repeated while num is greater than 0
while num > 0:
This appends the remainder of num divided by 2 to the front of the binary variable bin
bin = str(num%2)+bin
This calculates the floor division of num and 2
num//=2
This prints the required output
print(str(temp)+" in binary is "+str(bin))