First of all X and Z both are equal to zero . Next thing , that as data type ‘int’ is 32 bit and ,1 when shifted left 32 bits leaves all zeroes , so you get 0 as answer.
Try 2>>4
you
First of all X and Z both are equal to zero . Next thing , that as data type ‘int’ is 32 bit and ,1 when shifted left 32 bits leaves all zeroes , so you get 0 as answer.
Try 2>>4
you’ll get 32
and 2>>32 gives zero too
whereas 2>>30 gives –2,147,483,648