Int x=~1;what is the value of x?
Answers
Answered by
5
Answer:
i think the answer is -2
#hope it helps you
please mark brainliest
Answered by
1
The value of x will be -2
Explanation:
- represents bitwise negation.
- It computes the bitwise complement.
- Every 1 is replaced by 0 and every 0 is replaced by 1.
- The operand must have an integral type.
- The result has the same type as the operand.
- x is equal to 1.
So,
- Here MSB(Most Significant Bit) is 1 which denotes that the number is negative.
- Hence x=-2
Thus the value of x will be -2.
Similar questions
Math,
4 months ago
English,
4 months ago
Geography,
4 months ago
Social Sciences,
9 months ago
English,
9 months ago
Social Sciences,
1 year ago