Incredible hulk problem

i think my code is correct but it is showing wrong answers.
Pl. check my code.I m not able to point out my mistake;

hey @lakshaygarg128 can you please briefly explain your approach?

Correct approach of this question is to find the number of set bits in the give n, and here is code to do so.