Binary number
-It is a number which expressed in the base-2 numeral system,
-Binary numbers are 0 or 1.
1's compliment of the binary number-
example-
Binary number is 1010101
its 1's compliment is 0101010
Binary number is 101
its 1's compliment us 010
Program-
n=int(input("Enter binary numbern"))
c1=""
while(n):
t=n%10
if t==1:
c1=c1+"0"
else:
c1=c1+"1"
n=int(n/10)
print("1's compliment is - "+c1[::-1])
Enter binary number
11111111
1's compliment is - 00000000
Enter binary number
101
1's compliment is - 010