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

Write a program to show the change in position of a cursor using c

580


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1705


What is NULL pointer?

677


Can we compile a program without main() function?

634


What is the scope of static variable in c?

535






How we can insert comments in a c program?

632


What is string concatenation in c?

568


What is the size of empty structure in c?

595


What do mean by network ?

659


What is %s and %d in c?

592


Where can I get an ansi-compatible lint?

642


What is null pointer constant?

594


What are the general description for loop statement and available loop types in c?

687


What do you mean by c what are the main characteristics of c language?

572


Explain why can’t constant values be used to define an array’s initial size?

856