Why am i get wrong answer. i have also run same code in dev c++,then i get right answer but In coding block ide i am getting wrong answer

there is code id of problem

Initialise count as zero in your cntSetBits function.

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.