While loop conditon problem

in while loop , if the condition is true then the program will enter the loop and perform a certain operation. But here, the condition is while((temp & 1) ==1)… Let the xor is 1000, so 1000 & 1 is not 1 . so the program will not enter the loop and our position will not be increased.

hello @rick711c

pls watch compelte video, in later part of the video bhaiya corrected this condition.

it should be (temp&1)!=1

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.