The first two operators are unary operatorsthey take just one operand. The remaining five are binary operators, taking two operands. Unary plus and minus are used as follows:
-54 +259.65 -rate
You almost never use the unary plus. Without any sign, a numeric constant is assumed to be positive anyway.
Unary Operator An operator that has just one operand.
Binary Operator An operator that has two operands.
You may not be familiar with integer division and modulus (%). Let's look at them more closely. Note that % is used only with integers. When you divide one integer by another, you get an integer quotient and a remainder. Integer division gives only the integer quotient, and % gives only the remainder. (If either operand is negative, the result may vary from one C++ compiler to another.)
In contrast, floating point division yields a floating point result. The expression
7.0 / 2.0
yields the value 3.5.
Here are some expressions using arithmetic operators and their values: