0

# difference between x++ and ++x?? precedence of these 2 increment operators? same for x-- and --x

1 Answer

+ 1

lets us understand with ex
int x=2,int y;
y=x++;
//now y=2
int x=2,int y;
but if we do
y=++x;
//now y=3
so ++x do increment before evaluating
and x++ evaluates before increment.
same is applied for x-- and --x.
hope helps.