[algogeeks] C output 3

2011-07-29 Thread Ankur Khurana
Please explain the output, that why is it in that form in hexadecimal form #includestdio.h int main() { printf(%d %x,-11,-11); return 0; } output : -2 fffe -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

Re: [algogeeks] C output 3

2011-07-29 Thread aditi garg
this is bec -1 in hexadecimal is On Fri, Jul 29, 2011 at 11:37 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: Please explain the output, that why is it in that form in hexadecimal form #includestdio.h int main() { printf(%d %x,-11,-11); return 0; } output : -2

Re: [algogeeks] C output 3

2011-07-29 Thread sukhmeet singh
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 ankur.kkhur...@gmail.comwrote: Please explain the output, that why is it in that form in hexadecimal form #includestdio.h int main() { printf(%d

Re: [algogeeks] C output 3

2011-07-29 Thread Ankur Khurana
i figured it out. I didnt know before that is was in 2's complement form . On Fri, Jul 29, 2011 at 11:53 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: 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

Re: [algogeeks] C output 3

2011-07-29 Thread prashant bhutani
fffe 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 = 1110, ~fe = 0001, ~fe+1 = 0010 = 2 which gives your answer. Thanks Regards, Prashant Bhutani Senior Undergraduate Computer Science Engineering (B.Tech) Institute of