Computer Science, asked by vijayna9946, 10 months ago

Positive or negative number using bitwise operators

Answers

Answered by SnehaG
0

Explanation:

When we do a -n>>31, if it is a positive number then it will return -1 as we are doing -n>>31 and the vice versa when we do for a negative number. So we know it returns 0 when it is a negative number, it returns 1 when it is zero, returns 2 when it is a positive number.

Similar questions