Arithmetic Operators
What Are Arithmetic Operators in C#?
C# arithmetic operators perform mathematical operations such as addition, subtraction, multiplication, division, and modulus between numeric data types. These operators are binary operators, which need two operands to perform the operations.
List of C# Arithmetic Operators
Following table shows all the arithmetic operators supported by C#. Assume variable A holds 10 and variable B holds 20, then −
| Operator | Symbol | Description | Example |
|---|---|---|---|
| Addition | + | Adds two operands | A + B = 30 |
| Subtraction | - | Subtracts second operand from the first | A - B = -10 |
| Multiplication | * | Multiplies both operands | A * B = 200 |
| Division | / | Divides numerator by de-numerator | B / A = 2 |
| Modulus | % | Modulus Operator and remainder of after an integer division | B % A = 0 |
| Increment Operator | ++ | Increment operator increases integer value by one | A++ = 11 |
| Decrement Operator | -- | Decrement operator decreases integer value by one | A-- = 9 |