Arithmetic Operators
Get introduced to arithmetic operators in Dart.
A list of operators
Arithmetic operators are operators that perform arithmetic operations such as addition and subtraction. Below is a list of the arithmetic operators supported by Dart.
Operator | Use |
---|---|
+ |
Adds two operands |
- |
Subtracts the second operand from the first |
- expr |
Reverses the sign of the expression (unary minus) |
* |
Multiplies both operands |
/ |
Divides the first operand by the second operand |
~/ |
Divides the first operand by the second operand and returns an integer value |
% |
Gets the remainder after division of one number by another |
Taking the first operand to be 10 and the second operand to be 7, let’s look at an example for each operator.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy