*#includestdio.h
void main(void)
{
int a=10,b;
b=a++ + ++a;
printf(%d,%d,%d,%d,b,a++,a,++a);
}
*what is the answer?how are the function parameters passed on the stack?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
The answer will be compiler dependent.Google Sequence Point in C.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
the output is 22 13 13 as increment and decrement operators associate from
right to left hence first ++a will be evluated which makes a=11 then a++ is
evaluated as its a postfix operation hence b=a+a=11+11=22 and after this a
=12 then in printf statement again right associativity follows hence ++a