Carry out calculations using numbers, variables, and arithmetic operators.
Details
Arithmetic operations can be performed on variables to manipulate values in a program.
Perform Arithmetic Operation in C#
💻 C#
int x = 6 int y = 2 int sum = x + 3; // addition: 9 int difference = x - y; // subtraction: 4 int product = x * 5; // multiplication: 30 int quotient = x / y; // division: 3
Related Concepts
- Uses: Arithmetic Operator
- Uses: Variable