<<< Examples of simple assignment statements | Index | Arithmetic Assignment Operators >>> |
Statements that use the same variable on both sides of the equals sign:
count = count + 1; // count is increased by 1 count = count – 1; // count is decreased by 1 total = total + 100.0; // total is increased by 100.0 total = total – 100.0; // total is decreased by 100.0 price = price * .8; // price is multiplied by .8 sum = sum + nextNumber; // sum is increased by value // of nextNumber
<<< Examples of simple assignment statements | Index | Arithmetic Assignment Operators >>> |