while loop for bitwise conversion program
The &amp; operator is a bitwise &quot;AND&quot;. Since the binary representation of 1 consists only of a 1 on the least significant bit, the operation c &amp; 1 checks if $c$ contains a 1 on the least significant bit. Another way to say it is that c &amp; 1 is the remainder of $c$ modulo 2, that is 0 if $c$ is even and 1 if $c$ is odd.
The &gt;&gt; is a logical shift right, that is the deletion of the least significant bit.
For example, if $c = 26 = (11010)_2$, the steps are:

c &amp; 1 = 0 so count is not modified. $c$ becomes $1101$;
c &amp; 1 = 1 so count is incremented. $c$ becomes $110$;
c &amp; 1 = 0 so count is not modified. $c$ becomes $11$;
c &amp; 1 = 1 so count is incremented. $c$ becomes $1$;
c &amp; 1 = 1 so count is incremented. $c$ becomes $0$.
c != 0 is not true so the algorithm stops. count was incremented thrice, and three is indeed the number of 1's in the binary representation of $c$.