Given an integer **n**, write a program to find the one’s complement of the integer.

**Input:**

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.

**Output:**

For each test case, print one's complement of N in a new line.

**Constraints:**

1 <= T <= 10^{4}

1 <= N <= 10^{6}

**Example:
Input**:

2

5

255

2

0

**Explanation:**

**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.

mantan_g | 267 |

tushki | 198 |

aksht7 | 182 |

ayush1101 | 128 |

namansharmacse17 | 110 |

ARUN_PUNDIR | 730 |

manishgupta8497 | 627 |

AMAN__JAIN | 625 |

Abhimanyu_kumar | 562 |

AJ786 | 541 |

blackshadows | 5335 |

Ibrahim Nash | 5223 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4584 |

Login to report an issue on this page.