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
Write a program to show the change in position of a cursor using c
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
What is NULL pointer?
Can we compile a program without main() function?
What is the scope of static variable in c?
How we can insert comments in a c program?
What is string concatenation in c?
What is the size of empty structure in c?
What do mean by network ?
What is %s and %d in c?
Where can I get an ansi-compatible lint?
What is null pointer constant?
What are the general description for loop statement and available loop types in c?
What do you mean by c what are the main characteristics of c language?
Explain why can’t constant values be used to define an array’s initial size?