Bitwise operators and negative numbers

Can we use bitwise operators on negative numbers.

right shift operator is not genarating correct expected output with negative numbers

hi @ritikbunty2511_729d0258992e0982 it should work fine check this

bhaiya but when we right shift negative number it should produce positive one as sign bit get filled with 0.

hi @ritikbunty2511_729d0258992e0982 read here https://www.codespeedy.com/right-shift-negative-numbers-in-cpp/, msb is fixed