Arithmetic Operators

Arithmetic operators are used to conduct mathematical operations in your code. The chart below contains the different types of arithmetic operators you can use in C:

Addition

The first one, “ + ”, is the addition operator, which allows you to add numbers together. You can use it with regular numbers, and with variables too.

Examples:

int num = 21 + 46;
int num1 = 21;
int num2 = 46;
int num3 = num1 + num2;

Subtraction

The second operator, “ - ”, is the subtraction operator, which allows you to subtract a number from another. Like the addition operator, you can use it with regular numbers, and with variables too.

Multiplication

The third operator, “ * ”, is the multiplication operator, which allows you to multiply numbers together. Like the operators we have discussed already, you can use it with regular numbers and with variables too.

Division