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.

_Shubham_Jain_06 | 404 |

maggiiiii | 315 |

Savage_19 | 310 |

ritikdagar0203 | 241 |

thanuvinu94 | 233 |

Bishnu Dev Panda | 810 |

_Shubham_Jain_06 | 715 |

okayboss | 652 |

maggiiiii | 598 |

Savage_19 | 576 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4925 |

Quandray | 4547 |

Login to report an issue on this page.