Please help me find my mistake

Problem - interesting XOR
https://www.codechef.com/problems/IRSTXOR

My Solution
https://www.codechef.com/viewsolution/50007511

Consider input:
8

3 Likes

Thank you @akshitm16 for replying. I found my mistake. My code was producing wrong results for numbers in the form of 2^n (2 to power of n). It was performing one less loop on that. So the correct solution would be to put '<=" sign in the while loop instead of ‘<’.

2 Likes