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.
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.
For each test case, the output is the integer displaying the XOR of a & b after making them of equal lengths.
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.
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.