On the Internet, you can find a lot of programs in the Pascal language, but it’s much harder to figure out how they work and how they work. Let's learn the basics of programming together!
Algorithmic language: basic concepts
In colloquial speech, we use the basic units: symbols, words, phrases and whole sentences. Algorithmic language also has a similar structure, only its components are called differently. We are talking about elementary constructions, expressions and operators. All these units form a hierarchical structure, since each subsequent element is formed from the previous one.
Symbols of an algorithmic language are indivisible atoms used to write code.
Elementary constructions are minimal units that have their own meaning.
.
, . , - . .
""
. "" ( ) . , . :
, "", .
"" , .
, , . , , . , .
"" – , , . , .
– , . , , , , , , . . , 63 . "", , , !
, , , , , .
, , .
, (""). , !
(;) – , . : const, var, begin .
end , . , .
. , n=13, n:=13.
, .
""
. "" . , .
, . . : string real.
, , , . . , , .
"". . , , . .
"" – , , . , begin end. , , .
"", , , . .
, . , – .
:
IF <> THEN <1> ELSE <2>.
else, then if , – , – .
, – , , "". .
, , . , Program MyFirst.
, , , , , , .
uses. . .
, .
.
, : "var c,a,r: integer; k,l, m: char; h1,h2: boolean;".
, "" – , , .
.
"" – , .
, «It is my first program!»
"" , .
Begin
Writeln (It is my first program!');
End.
!
, . .
, "" .