Assunming, integer is 2 byte, What will be the output of the program?
#include<stdio.h>
int main()
{
printf("%x\n", -1>>1);
return 0;
}
[A]. ffff
[B]. 0fff
[C]. 0000
[D]. fff0
Answer: Option A
i dont understand why it produces ffff
actually -1 = ffff
there shoud be one bit zero ( ie msb. )
pls explain anyone.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.