Test Cases not passing

My code is not passing the testcases but the answer is correct when I am passing sample inputs. I tried to code using the hint video.

Hi @vritant2405
Please share ur code or u can refer to my code https://ide.codingblocks.com/s/610597

Here is my code below.

#include<bits/stdc++.h>
using namespace std;

int getbit(int n,int i)
{
return (n&(1<<i));
}

int setbit(int n,int i)
{
return (n|(1<<i));
}

int unsetbit(int n,int i)
{
return (n&((~0)<<i));
}

int main()
{
int a,b;
cin>>a>>b;

int chga=a,chgb=b;

for(int i=63;i<=0;i--)
{
    int bita = getbit(a,i);
    int bitb = getbit(b,i);

    if((bita^bitb)==1)
    {
        continue;
    }
    else
    {
        if(bita == 0)
        {
            setbit(chga,i);
            if(chga<b)
            {
                setbit(a,i);
            }
            else
            {
                unsetbit(chga,i);
            }
            
        }
        if(bitb == 1)
        {
            unsetbit(chgb,i);
            if(chgb>a)
            {
                unsetbit(b,i);
            }
            else
            {
                setbit(chgb,i);
            }
            
        }
    }
    
}

cout<<(a^b)<<endl;
return 0;

}

hi… pls refer the code i have sent

understood. thanks…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.