All digits of a number

i want to access all the digits of a number ,this code is wrong ,why??

Can you please mention the question.

its not any question btw , i just want all the bits of a number .and its showing wrong output…can you tell me the possible reason

Your approach is correct. However the variable a is supposed to be a decimal number. Code will take 11100 as a decimal number and bitwise operation will be performed on its binary equivalent.Check the binary form of 11100 at https://www.rapidtables.com/convert/number/decimal-to-binary.html
You will observe that your output is just the reverse of its binary equivalent which is correct.

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.