like this? can you give me more exercises it's actually so fun
Yep. That's it.
You can find a lot of exercises online with Google. Just search for
pascal exercises.
For example:
First create an array of 100 random numbers and then print out the highest number.
If you want to find exercises and tutorials on Pascal you can search for
pascal tutorial pdf. (Or any combination with
Pascal and
Pdf in the search.
A lot of online resources have Pascal examples where you see writeln in the code.
For instance:
program test;
begin
writeln('Hello world');
end.
You can use such code in Lazarus by choosing Project > New Project > Simple Program
But when you run it, it will quit without showing you the world
(you get a black screen real fast with Hello world and it closes immediately)
You need to pause the program at the end of the program just put a readln; before the end.
Like this (try it):
program Project1;
uses sysutils;
var
i: integer;
begin
i:=33;
while i<600 do
begin
writeln(inttostr(i));
i:=i+33;
end;
readln; // <--- add this in online examples so the screen doesn't close
end.
Just beginning with some of these simple programming techniques you'll learn the basics and the more complex programs will follow.