I know this has been discussed umpteen times before.
But can anyone come up with an easier explanation.....preferably in layman terms to make a new bee happy!?
As we have used post increment first the value of x is stored in i and the value of x is incremented. so the values of x and i are 2 ,1 respectively.
int x=1;
int i=++x;
As we have used pre increment first the value of x is incremented and the that incremetned value is stored in i. so the values of x and i are 2 ,2 respectively.