Given an integer n, write a program to find the one’s complement of the integer.
The first line of the input contains an integer T denoting number of test cases. Each of the following T lines will contain an integer N.
For each test case, print one's complement of N in a new line.
1 <= T <= 104
1 <= N <= 106
Testcase 1:If n=5, its decimal representation is 101 and its one's complement is 010 i.e, 2.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.