Given two numbers say a and b. Print their XOR after making the lengths of their binary representation equal by adding trailing zeros to the binary representation of smaller one.

**Input:**

The first line of the input contains integer T denoting the number of test cases. For each test case, there are two integer inputs **a & ****b.**

**Output:**

For each test case, the output is the integer displaying the XOR of **a & b** after making them of equal lengths.

**Constraints:**

1<=T<=100

1<=a,b<=10^{7}

**Example:
Input:**

4

2 6

3 10

5 24

1 20

2

6

12

4

**Explanation:**

1. The binary representation of 2 is 10 and of 6 is 110. As the length of "10" is smaller, so add a '0' to it making it "100', to make the length of binary representations equal. XOR of 100 and 110 gives 010 which is 2.

Author: Vanshika_pec

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.

bruceewayne | 113 |

shivam123ahuja | 98 |

BoggavarapuRamSaranSaiSrinivasGupta | 98 |

rajupraaa1234 | 95 |

SUZAKU | 92 |

mr_kksparrow | 433 |

manvirag982 | 294 |

snow_den_ | 236 |

Exception_404 | 236 |

PranathiBhuvanagiri | 232 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.