fffffffe is two's complement of 2. Let me explain for fe and you can extrapolate it with other f's. f =15, e =14. fe = 11111110, ~fe = 00000001, ~fe+1 = 00000010 = 2 which gives your answer.
Thanks & Regards, Prashant Bhutani Senior Undergraduate Computer Science & Engineering (B.Tech) Institute of Technology - BHU (IT-BHU) Varanasi-221005 On Fri, Jul 29, 2011 at 11:53 PM, sukhmeet singh <[email protected]>wrote: > I couldn't understand the problem .. u have used %x as indentifier that why > it is so > > On Fri, Jul 29, 2011 at 11:37 PM, Ankur Khurana > <[email protected]>wrote: > >> Please explain the output, that why is it in that form in hexadecimal form >> >> >> #include<stdio.h> >> >> int main() >> { >> printf("%d %x",-1<<1,-1<<1); >> return 0; >> } >> >> >> output : >> >> -2 fffffffe >> >> >> -- >> 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. >> > > -- > 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. > -- 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.
