Arithmetic operators

Arithmetic operators

Now that we’ve covered the basic data types, it’s time to go over the arithmetic operators.  The arithmetic operators are + (add), – (subtract), * (multiply), / (divide), and % (modulus).

The use of the operators is fairly simple:

int x = 9;
int y = 10;
int z = x * y; /*Multiplies x times y*/

z = x + y; /*Adds x and y*/
You must sign up to see the rest of this content.