C++ XOR, simple solution
Approach: \n\n- Find the first number which is greater than "num" and have all 1s (Eg: 1, 3(11), 7(111), 15(1111), ...)\n- The relation b/w numbers with all 1s 
Approach: \n\n- Find the first number which is greater than "num" and have all 1s (Eg: 1, 3(11), 7(111), 15(1111), ...)\n- The relation b/w numbers with all 1s is 2x + 1, starting from x=1\n- Finally xor the num with x.\n- If num = 5(binary 101), x evaluates as 7 (binary 111) and (num^x) evaluates as 010 which is compliment of  5\n\n\t\n```\nint bitwiseComplement(int num) {\n\tint x = 1;\n\twhile(x<num) x = 2*x + 1;\n\treturn num^x;\n}\n```
['C', 'C++']