Arithmetic Operator : Learn C++ Programming Language |
Arithmetic operator:
- Operators are used to perform operations on variables and values
- The values that an operator acts upon are called operands
- So in an expression such as 4 * 5, the operands are 4 and 5.
- Operators such as multiplication that require two operands are called binary operators.
- Operators that require one operand are called unary operators.
- An example of a unary operator is the minus sign in the expression -height
Basic arithmetic operation:
Addition, Subtraction, Multiplication, Division, Modulus (+, - , * and /)
Modulus:
The modulus operator, % produces the remainder after integer division.
0 Comments