Incredible hulk problem

please explain what we actually had to do

I hope you have understood the question. The catch is that you have to display the number of set bits only. And that will be the answer.

no of set bits of x or n

Number of set bits of the input values

@Learning_bunny Please mark your doubt as resolved if you are satisfied.

https://ide.codingblocks.com/s/194893 sir it is not submitting…it only giving compilation successful nothing else, is their something wrong with the code

You forgot to decrease the value of t in the while loop.
Just add a “t–;” statement.