top of page

04 Operators

++ (increment) / -- (decrement)

Increment or decrement a variable

x++;  // increment x by one and returns the old value of x

++x;  // increment x by one and returns the new value of x

x-- ;   // decrement x by one and returns the old value of x

--x ;   // decrement x by one and returns the new value of x 


x: an integer or long (possibly unsigned)

© 2021 Odyssey Navigator. All rights reserved.

bottom of page