Concept Flow - Arithmetic operators
Start
Read operands
Choose operator (+, -, *, /, %)
Perform calculation
Store/Display result
End
This flow shows how arithmetic operators take two numbers, perform the chosen operation, and produce a result.
int a = 10; int b = 3; int sum = a + b; int diff = a - b; int prod = a * b; int div = a / b; int mod = a % b;
| Step | Operation | Operands | Calculation | Result |
|---|---|---|---|---|
| 1 | Addition | a=10, b=3 | 10 + 3 | 13 |
| 2 | Subtraction | a=10, b=3 | 10 - 3 | 7 |
| 3 | Multiplication | a=10, b=3 | 10 * 3 | 30 |
| 4 | Division | a=10, b=3 | 10 / 3 | 3 (integer division) |
| 5 | Modulo | a=10, b=3 | 10 % 3 | 1 |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | After Step 4 | After Step 5 |
|---|---|---|---|---|---|---|
| a | 10 | 10 | 10 | 10 | 10 | 10 |
| b | 3 | 3 | 3 | 3 | 3 | 3 |
| sum | undefined | 13 | 13 | 13 | 13 | 13 |
| diff | undefined | undefined | 7 | 7 | 7 | 7 |
| prod | undefined | undefined | undefined | 30 | 30 | 30 |
| div | undefined | undefined | undefined | undefined | 3 | 3 |
| mod | undefined | undefined | undefined | undefined | undefined | 1 |
Arithmetic operators in C#: + addition - subtraction * multiplication / division (integer if both operands int) % modulo (remainder) Operands must be numbers; integer division discards decimals.