in case of -ve numbers irrspectiveof size of compilerits repesented as ffff
in remanig space apart from the space of binaryequivalent of number.hence u
get ffff

On Sun, Aug 8, 2010 at 9:37 PM, navin <navin.myhr...@gmail.com> wrote:

> 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 algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
yezhu malai vaasa venkataramana Govinda Govinda

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to