Basic Operators


  1. Which operator is used to invert all the digits in binary representation of a number?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Unary not operator, ~, inverts all of the bits of its operand in binary representation.


  1. Which right shift operator preserves the sign of the value?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    None



  1. On applying Left shift operator, <<, on an integer bits are lost one they are shifted past which position bit?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The left shift operator shifts all of the bits in a value to the left specified number of times. For each shift left, the high order bit is shifted out and lost, zero is brought in from right. When a left shift is applied to an integer operand, bits are lost once they are shifted past the bit position 31.


  1. Which of these statements are incorrect?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The right shift operator automatically fills the higher order bit with its previous contents each time a shift occurs. This also preserves the sign of the value.



  1. Which of these is not a bitwise operator?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    <= is a relational operator.