Adobe Interview Question
Testing / Quality AssurancesCountry: United States
Interview Type: Phone Interview
The first bit of Y which was previously being used to represent its sign will now be used to represent just its value (just for comparison). Y actually does not change. The value of Y during comparison with X is 4294967294.
The value of y which is stored in computer (-2) is as follows
(binary form and assuming 32 bits ) : 11111111 11111111 11111111 11111110 . Now this binary representation is for Signed numbers . If it is converted to unsigned , then nothing changes . Simply convert this binary number to decimal INCLUDING the most significant bit i.e the 32nd bit . Hence the decimal number will be 2^(0) + 2^(1)+2^(2)+.......2^(31)=4294967294
Hope this helps :D
nice question, just came to know that on comparison of unsigned and signed, signed is converted to unsigned. so answer will be "Y is greater"
- abhishekatuw January 29, 2012