Lesson5: Operators, Expressions and Operator Precedence (Arithmetic Operations)
Arithmetic Operators
Addition (+)
-Takes the sum of two or more variables, two or more constants, or a combination of both.
Subtraction(-)
-Takes the difference of two or more variables, two or more constants, or a combination of both.
Multiplication(*)
-Takes the product of two or more variables, two or more constants, or a combination of both.
Division
-Takes the quotient of two or more variables, two or more constants, or a combination of both.
Modulo(%)
-Takes the sum of two or more variables, two or more constants, or a combination of both.
Here is an example of a program that uses Arithmetic Operators:

It is also possible to assign the results to different variables and print these variables. Here is how it goes:

Operator Precedence
Operator precedence is an important thing in C++ and other programming language. It is a must to know for each and every programmers how this works so here are the rules and an example program:
Rules:
- Operations *, /, and % are solved first. It is also solved from left to right.
- + and – are next. Like the first, it is also solved from left to right.
- If there are operations inside ( ), it is solved first then rule 1 and rule 2. If multiple parenthesis are in an equation like (3+2)*(2/1), 3+2 is solved first, then 2/1, and after that the sum and quotient are multiplied.

It is always ideal to add parenthesis in long equations to easily understand the given equation.
