A Crash Course in Pascal - 2024
A Crash Course in Pascal - 2024
Course in
Pascal
By: GT
Things to KNOW
When programming in
Pascal, There are certain
KEY things to remember in
order to avoid errors.
Comparative statements
Blocks including / * + - = operators
Loops & iterations
Nested comparative statements
Nested loops and iterations
Have you also noticed that the quotation marks are not
used with readln ?
How do we print the value that a variable has ??
To print a variable to the screen you can use one of 2 ways. Eg
When you would like to add a message before the value, use the top
option.
To print just the value to the screen you can use the last option.
The sentinel is this case is X, and the loop will execute until X
= 10.
The body of the loop starts with a REPEAT and ends with an
UNTIL the sentinel, X=10; Please notice that in the line
before the loop starts, X was assigned the value of 0, X:=0;
Comparative Statements
If you are not familiar with IF-THEN-ELSE, then you should try and
remember this. IF this condition THEN do this ELSE do that. Its
really that simple.