Arithmetic operators and expressions
The expression on the right side of the assignment operator allows you to calculate values using various formulas.
What expression can contain
1) integer and real numbers (in real numbers, the integer and fractional parts are separated by a dot, not a comma, as is customary in mathematics)
2) signs of arithmetic operators:
+
addition
-
subtraction
*
multiplication
/
division
%
remainder of the division
3) standard mathemtical functions (we can use the math module math.h write at the top of the program #include<math.h>
)
abs(i) - |i|
- absolute value of an integer i
fabs(x) - |x|
- absolute value of a real числа x
sqrt(x) -
\(\sqrt x\)
pow(x,y) -
xy
4) parentheses to reorder