4.15 LAB: Convert to reverse binary
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in reverse binary. For an integer x, the algorithm is:

As long as x is greater than 0
Output x % 2 (remainder is either 0 or 1)
x = x / 2

Please help me!!

415 LAB Convert to reverse binary Write a program that takes in a positive integer as input and outputs a string of 1s and 0s representing the integer in revers class=

Respuesta :

A program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in reverse binary is

num = int(input())

while num > 0:

   y =(num % 2)

   print(y, end='')

   num = (num//2)

print()

num = int(input("Enter a number"))

string = ""

while num > 0:

   y =str(num % 2)

   string+=y

   num = (num//2)

reverse=string[::-1]

print(reverse)

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1