Basic Operators
- Which operator is used to invert all the digits in binary representation of a number?
-
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.
- Which right shift operator preserves the sign of the value?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
None
- On applying Left shift operator, <<, on an integer bits are lost one they are shifted past which position bit?
-
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.
- Which of these statements are incorrect?
-
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.
- Which of these is not a bitwise operator?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
<= is a relational operator.