How Does Increment Operators Work...??

This is a discussion on How Does Increment Operators Work...?? within the C Programming forums, part of the General Programming Boards category; if the given expression is itself in that form and asked to program on it then how to convert it ...

1. if the given expression is itself in that form and asked to program on it then how to convert it
You should ask the person who gave you that expression what it means.

2. he himself is blank so posted in da forum

3. he himself is blank so posted in da forum
In that case the expression has no meaning, or has an arbitrary meaning (i.e., any meaning that you, or the compiler, assign to it).

4. actually i m working on linux

5. That makes no difference concerning the undefined behaviour.

6. yO i know tht....!!

7. Solution

Originally Posted by ajayd
please tell me for this expresion :
a = (b++) + (- - b) + (b - -) + b
here b = 4
tell me manually ans : i am getting 15
by applying your logic i am gettin 17
plz check.....!!
hey first evaluate pre increment or pre decrement in any expression then solve the expression without bothering post increment or post decrement
here for b = 4
a = b++ +(--b) + (b--)+b;
a= b++ +3 +(b--)+b;
a= 3+3+3+3;
a=12;

8. Originally Posted by Amito
hey first evaluate pre increment or pre decrement in any expression then solve the expression without bothering post increment or post decrement