Current location - Training Enrollment Network - Mathematics courses - What is an arithmetic operator?
What is an arithmetic operator?
Arithmetic operators are operators that perform mathematical operations. There are mainly+(addition),-(subtraction), * (multiplication),/(division) and% (taking the remainder).

The operation rules are the same as those in mathematics. Multiply first, then divide, then add and subtract. If there are brackets, count them first.

For example:

int a=8,b=3,c;

//c is equal to 1 1.

c = a+b;

//c is equal to 5.

c = a-b;

//c is equal to 24.

c = a * b;

//c is equal to 2 (divisible).

c = a/b;

//c equals 2 (remainder)

c = a % b;