An Engineer's Literature

Language spoken by engineers!

Lesson6: Additional Assignment Operators

Accumulation Statement

Accumulation statement is assigning a value to a variable using this variable as a part of the equation.

Example:

Picture23

Additional Assignment Operators

There is also a shortcut for accumulation statement: +=, -=, *=, /=, %=.

Here is an example on how it works:

Picture24

The same rule is also applied for the other operators.

Increment and Decrement Operators

Increment Operator

This has a symbol of ++ which just means to increase the value by 1.

Decrement Operator

This has a symbol of ++ which just means to increase the value by 1.

Examples for these operators will be on the upcoming lessons.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.