005# puzzle on c (output )

@dholey (1383)
India
February 4, 2007 4:54am CST
ITS ANOTHER GOOD PUZZLE , PLEASE TELL ME THE OUTPUT AS WELL AS THE REASON FOR THAT OUTPUT ...... AND PLEASE DO CHECK COMMENTS ADDED TO YOUR RESPONSE ...... void main() { int i=3; int j; j= sizeof(++i + ++i); printf("\n %d %d",i,j); }
2 responses
@Lifeless (2635)
• India
4 Feb 07
Thats pretty simple... The output will be 3 2 Its becoz, i will reamin as it is but j will display a value 2 becoz size of an integer is 2 bytes and the fuction sizeof() converts this value into integer 2 and displays it...
@dholey (1383)
• India
4 Feb 07
why the output is not 5 and 2 as i is incremented twice and that to pre incremented ... explain it .......... and remember when you are solving puzzles dont use pc .... if it is this much simple then explain it .... i will make it as the best response....
@dholey (1383)
• India
4 Feb 07
how amny of you thing the lifeless' answeris correct (he said it was so easy) .... just asking you... because i know lifeless is not a programmer and he just added one post .... fortunaitly he had c++ on his pc so he executed the program and said it is so simple.... i want to ask him only why i is not 5 ...(if he knows anything like unary operator or working of pre / post increment/ decrements ) i know he can not explain ... he just came to add one post nothing else ... and i am annoyed ..... if he has a little knowledge then he must have also given the answer to the next puzzle ... but he cant explain so ... here he is ........ i hate imposters .. pretenders ... so i hate you ...
• India
12 May 07
3 2.