Course Content
Programming in C
About Lesson

Expressions such as

x = x + 5

where the variable on the left hand side is used on the right hand side, can be written as

x += 5

The += operator is called an assignment operator.
Most binary operators have a corresponding assignment operator, op=, where op is one of

+  -  *  /  %  <<  >>  &  ^  |

Note that

x *= y + 1

means

x = x * (y + 1)
Scroll to Top