# Programming in Pascal language

The most important commands from Pascal programming language in one place, a unique comparison and each command-operator is shown using a piece of program. Statements-operators of these sample programs are clickable, so with a simple click we have more information available.## Programming language Pascal:

## lexical elements

Lexical elements are numeric, string constants and comments in the code.

## types and variables

Types and variables are closely related because variables are the most important elements of our program in which we store data, partial results of our calculations. Types tell us what data can be stored in variables.

## program structure

## operators

Operators perform an operation between the operands, this operation can be mathematical, logical, or bitwise.

## statements

Statements are important elements for writing programs. Generally one statement line corresponds to one line program. The main group of the statements are: cycles, program branching and flow control.

## Pascal

```
i := x * 5;
while i>0 do
if i=10 then
break
else
begin
dec(i);
end;
```

### Examples - Pascal

## Pascal

```
x := 250 div 8; { x=7}
y := x div 3; { y=2}
z := (x * 2 div y +5);{ z=9}
```

## Pascal

```
x := 8 shr 1; { x = 4}
y := $ff shr 4; { y = 15}
z := (x shr 2) shr 2; { z = 0}
```

## Pascal

Other pieces of example codes:if i - 10 >0 then i := i-5;

(10 >a or a<5)

`$AF`

z := longint((x * y));

(i and 4)

5 * 5

programming languages