Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

MY PROGRAMMES

Sunday, April 9, 2023

DECIMAL NUMBER TO BINARY NUMBER

n=int(input("Enter the decimal number = "))
while n!=0:
    d=n%2
    print(d,end="")
    n=n//2
#The number is to be reversed for eg: (144)base16 = (10010000)base2 but in program the result appears (00001001)base2