a=2;
b=a++ + --a +a++ + ++a; i m getting 6 after evaluating but the output is 5. How??
Since the increment/decrement operator modifies its operand, use of such an operand more than once within the same expression can produce undefined results. For example, in expressions such as a++ + --a , it may not be clear to a user in what sequence the subtraction and increment operations should be performed. Such expressions generally invoke undefined behavior, and should be avoided.