The >> operator is the 'right shift' operator and it shifts its left operand's bits to
the right by 'n' bits where 'n' is the value of its right operand. So a= a>>1 shifts
the bits of the value of a to the right one bit.
The loop condition tests whether or not a equals zero; if it isn't there's at least
one 1 bit left in the value of a so the loop continues to shift right the value one
more bit and over and over again until all the 1 bits are shifted out of a to the
right.
first compiler check the value of a; if it is not equal to zero it will proced after that st1 will execute then a will be right shift(>> is a right shift operator) once i.e lets take a value is 8, then binary is 1000 after right shift it will be 0100, so compiler will check the a value again now its value is 4, it will repeate till a value zero.
Comment