pascal multiple line if code
In Pascal, you can use the begin
and end
keywords to create multiple lines of code within an if
statement. Here's an example:
if condition then
begin
// code block 1
statement1;
statement2;
end
else
begin
// code block 2
statement3;
statement4;
end;
In this example, if the condition
is true, the code block 1 will be executed. If the condition
is false, the code block 2 will be executed. You can have multiple statements within each code block by separating them with semicolons.