Displaying text on the screen


Let's analyze a program that displays the phrase "Hello, world!"
begin
    writeln('Hello, World!');
end.

Let's take it in order:

begin - this is a keyword indicating the beginning of the action section - part of the program being executed.
writeln('Hello, World!'); - writeln()  - This is the name of the function responsible for displaying data on the screen. What we want to output is written inside the brackets. If we want to display some text, we put it in single quotes: 'for example' (For more on writeln see the previous task with id 37568).

end  - keyword, just like begin, only it denotes not the beginning of the action section, but its end (for more details, see the task with id 37563).< /span>

Output operator  to the screen in Pascal
Let's analyze some features of the output operator write (writeln). 

1) The difference between write  and writeln is that write moves the cursor to a new line after the text is displayed on the screen, and < code>write - no. That is, if you write:
  writeln('text1'); writeln('text2'); then we get:

text1
text2


And if you write like this: write('text1'); write('text2');
then on the screen we will see:

text1text2

2) You can pass multiple parameters to one output statement. They will be displayed in a row one after another, without spaces, line breaks and other additional characters. That is, by writing this:
  writeln('text1', 53, 'text2'); we get the output:

text153text2

Note also that write('a', 1, 'b'); is equivalent to:
  write('a'); write(5); write('b');
Practice by working with the source code of the program in the exercise! 
 

Many programming languages have special characters that just can not be output.
For example, commonly used special characters are backslash (\), quotation marks (") and apostrophes (')
Note that a regular slash (/) is not a special character!

To output such characters, we put a \ in front of each of them. That is, if we want to display the sign \, then in the output operator it is necessary to write \\

REMEMBER
To display the characters \, ", ', you must put a \ in front of them

Let's practice to output such characters on the screen.