Explanation: x is promoted to unsigned int on comparison. On conversion x has all bits set, making it the bigger one. 3. Which of these expressions will return true if the input integer v is a power of two?
A. (v | (v + 1)) == 0;
B. (~v & (v – 1)) == 0;
C. (v | (v – 1)) == 0;
D. (v & (v – 1)) == 0;
Answer:A
Explanation: x is promoted to unsigned int on comparison. On conversion x has all bits set, making it the bigger one. 3. Which of these expressions will return true if the input integer v is a power of two?
A. (v | (v + 1)) == 0; B. (~v & (v – 1)) == 0; C. (v | (v – 1)) == 0; D. (v & (v – 1)) == 0;
Explanation: Power of two integers have a single set bit followed by unset bits. 4. What is the value of the following 8-bit integer after all statements are executed?