- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Arithmetic operators in Dart Programming

Arithmetic operators are used to perform different arithmetic operations.

These arithmetic operations mainly are −

Addition

Subtraction

Multiplication

Division

Modulus, etc.

Let's consider that we have two int variables named x and y, where x is storing the value 10 and y is storing the value 20.

In the below table, you can see all the arithmetic operators, with their symbol, name, what output they yield etc.

Consider the table shown below −

Operator | Name | Description | Output |
---|---|---|---|

+ | Addition | Addition of two or more operands | x + y = 30 |

- | Subtraction | Subtraction of the second operand from the first | x - y = -10 |

* | Multiplication | Multiplication of two or more operands | x * y = 200 |

/ | Division | Returns quotient after division | x / y = 0.5 |

% | Modulus | Returns remainder after division | x % y = 10 |

-expr | Unary Minus | Reverse the sign of the expression | -(x - y) = 10 |

Let's make use of all the above-mentioned operators in a dart program.

## Example

Consider the example shown below −

void main(){ var x = 10, y = 20; print("x + y is: ${x + y}"); print("x - y is: ${x - y}"); print("x * y is: ${x * y}"); print("x / y is: ${x / y}"); print("x % y is: ${x % y}"); print("- (x - y) is: ${-(x - y)}"); }

## Output

x + y is: 30 x - y is: -10 x * y is: 200 x / y is: 0.5 x % y is: 10 - (x - y) is: 10

- Related Articles
- Assignment operators in Dart Programming
- Bitwise operators in Dart Programming
- Relational Operators in Dart Programming
- Null Aware Operators in Dart Programming
- Test type operators in Dart Programming
- Comments in Dart Programming
- Constructors in Dart Programming
- Enumerations in Dart Programming
- Functions in Dart Programming
- Immutability in Dart Programming
- Inheritance in Dart Programming
- Iterables in Dart Programming
- Lists in Dart Programming
- Loops in Dart Programming
- Maps in Dart Programming

Advertisements