Thursday, April 18, 2024 23:38

Table of contents >> Introduction > Decrementing operator

Decrementing operator

Decrementing operator is the complementary part of the incrementing operator. What applies to the incrementing operator, also applies for the decrementing one.

Obviously, the difference is in the syntax and behavior. Decrementing operator can be expressed in four ways, just like incrementing one:

The difference in behavior should be obvious and self-explanatory: instead of adding, we subtract.

As for the incrementing operator, you should also be careful what kind of decrementing operator you are using (prefix or postfix).

The concepts explained in this lesson are also shown visually as part of the following video:

Tags: ,

Leave a Reply

Follow the white rabbit