Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Perform Arithmetic Operation

From Groundhog Learning

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