Playing with bits getting no output

hello @guptashubham210a
image

here u r updating i inside while loop due to which , correct counting of i is getting affected.

to rectify it , store i in some variable and use that variable to count number of set bits

I have tried by changing but then also error is coming

pls share ur updated code using cb ide.

image
u r not reading q.

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.