void main()
{
int i=5;
printf("%d",i++ + ++i);
}

Answer Posted / poseidon

I might agree with ANS #1 because side effects are
involved..The expected answer might not be getting always
although in case of printf(), the arguments are evaluated
from RTL. For example consider the case

int i=10;
printf("%d %d %d %d",i++,--i,i--,--i);
Try some variations of these and and find out whether you
are able to get correctly or not..
In case the result depends on the compiler,for
verification,I will add what my compiler gave me
ANS:7 8 9 8
If anyone find out,pls reply.. Keen to know..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to reverse singly link list.

611


How can I sort a linked list?

639


What is the purpose of scanf() and printf() functions?

725


What is the use of sizeof () in c?

562


How can I make it pause before closing the program output window?

585






What are runtime error?

634


What is a union?

613


pierrot's divisor program using c or c++ code

1734


When the macros gets expanded?

792


Why do we use int main?

616


Which control loop is recommended if you have to execute set of statements for fixed number of times?

813


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

592


What are local static variables? How can you use them?

650


what are the 10 different models of writing an addition program in C language?

1443


What is advantage of pointer in c?

698