Problem in Power of 2 code in C++

This is the code I have written for the program “Power of 2”. I have successfully submitted the code on Leetcode but in here it is giving me wrong answer. can anyone help me in this? Thank you in advance.

int main()
{

int n;
cin>>n;
if(n < 0){
    cout<<false;
}

int ctr = 0;
while(n > 0){
    if(n & 1 == 1){
        ctr++;
    }
    
    n >>= 1;
}

if(ctr == 1){
    cout<<true;
}
else{
    cout<<false;
}

return 0;

}

hello @HardCoderr

print true and false in quotes i.e “true” , “false”

Thank you so much Aman for helping.