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
Explain how to reverse singly link list.
How can I sort a linked list?
What is the purpose of scanf() and printf() functions?
What is the use of sizeof () in c?
How can I make it pause before closing the program output window?
What are runtime error?
What is a union?
pierrot's divisor program using c or c++ code
When the macros gets expanded?
Why do we use int main?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What are local static variables? How can you use them?
what are the 10 different models of writing an addition program in C language?
What is advantage of pointer in c?