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!