Assignment operator 
We already know that you can set the value of a variable using the input statement. The input statement is used in cases where the value is set by the user during program execution.
But very often we need to set a new value for a variable by calculating it using a certain formula. In this case, operator assignment.
 
The general form of an assignment operator is as follows <variable name> := <expression>;

The assignment operator works like this:
1. first, the expression to the right of the assignment sign is evaluated;
2. The resulting value of the expression is stored (they say "assigned") in the variable to the left of the assignment sign. In this case, the old value of the variable is erased.

For example, if we need to set the value of the c variable to twice the value of the b variable, then we will need to write it like this: c := 2 * b;
Do not forget that in programming you cannot omit multiplication signs in an expression. Otherwise, the computer will not understand what you want to multiply.
For example, you can't just write c := 2b, that would be wrong!

The expression on the right side of the assignment operator allows you to calculate values ​​using various formulas.

What an expression can contain
x integers and real numbers (in real numbers, the integer and fractional parts are separated by a dot, not a comma, as is customary in mathematics)
• arithmetic signs:  
+ addition,
- subtraction,
* multiplication,
div integer division,
mod remainder of division

x calls to standard functions (for some of them, you need to include the math library - for this, at the very beginning of the program, before declaring variables, you need to add the line "uses math;")
 abs(i) integer modulus i  
 sqrt(x) the square root of the real number x
 power(x,y) calculates x to the power of y

x parentheses to change the order of actions

Inline Functions
Any programming language includes many built-in functions that can be used in arithmetic expressions.
To use additional functions, you often need to include additional libraries.

For example, the most commonly used standard mathematical functions and how they are written in Pascal
 abs(i) number module i;
 sqrt(x) square root of x;
 power(x,y) calculates x to the power of y (always returns a real number).

It must be remembered that the function argument is always written in brackets.
For the power()  function to work, you need to connect an additional mathematical library.
You can do this by adding a line before the variable declaration: uses math; var ...

Recording arithmetic operations
Suppose we need to calculate an expression written in mathematical form in the following  way: 
\({ 2\ \cdot\ 17.56^2 \over {7\ \cdot\ 2.47\ \cdot\ 0.43}}\)

Rules for writing arithmetic expressions
1. An expression can contain numbers, other variable names, operation signs, parentheses, function names, arithmetic operations and their signs (+, -, *< /code>, /, div, mod).
2. The separator between integer and fractional parts is a dot.
3. The expression is written in one line (linear notation of expressions), characters are sequentially lined up one after another, ALL signs of operations are put down, parentheses are used.< br />
Thus, following the rules for writing arithmetic expressions, we must translate the given fraction (mathematical notation) into a linear notation, that is, write the fraction in one line. Since the numerator and denominator are complex (that is, they contain two or more factors), when writing an expression in a linear form, it is necessary to take the numerator and denominator in brackets.
Thus, the linear notation of such an expression will look like this:
 
(2*17.56*17.56)/(7*2.47*0.43)

Let's write a program to calculate the value of this expression. To do this, let's define the input and output data.

Input
Because we know all the values, then nothing needs to be entered from the keyboard, therefore there will be no input values.

Imprint
The program should display the result of the given arithmetic expression (the result can be saved to some variable, or immediately displayed on the screen).

In the program, we will immediately display the result on the screen. Since we have a fraction, the result will be a real number. 
  begin     writeln((2*17.56*17.56)/(7*2.47*0.43):9:6); end. Run the program on your computer and make sure it returns 82.949843.

 

Features of division in Pascal
There are three division operations in the Pascal programming language:
/ - division,
div - integer division, 
mod - computing the remainder of a division.

Things to remember:
1) The operation of calculating the remainder of division (mod) and integer division (div) are performed ONLY on integers numbers.
2) The division operation (/) always returns a real number, and its result cannot be written to an integer variable.

Let's look at examples of performing division operations: var i, n: integer; x:real; i := 7; x := i div 4; // x = 1.0000000000000E+000, use integer division and store the result in a real variable x := i / 4; // x = 1.750000000000E+000, use normal division n := i div 4; // i = 1 because we use integer division and store the result in an integer variable n := i mod 4; // n = 3, since we take the remainder of the division and write the value to an integer variable