Sail E0 Webinar
Question

What is the value of the following 8-bit integer after all statements are executed?
int x = 1;
x = x << 7;
x = x >> 7;


Options:
A .  1
B .  -1
C .  127
D .  Implementation defined
Answer: Option D

 Right shift of signed integers is undefined, and has implementation-defined behaviour.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers