Wats the value of the expression?

Hi everyone
I want to know how this expression works


int b=5;
int c=(b++)+(++b)+(++b)+(++b);
printf("%d",c);


The answer is coming out to be c=27...
Or the answer is undefined as there is no sequence point in the expression?

Help would be appreciated..

Most operators don't have a predefined sequence of evaluation of the operands so that may change depending on the compiler.
As b++, which returns the value of 'b' before being increased, may be executed after '++b' so it may return something different from 5
The answer is very, very, very undefined, as the standard does not define exactly when the postfix
operators are applied, nor the order of evaluation of the terms of the summation.
Topic archived. No new replies allowed.