Program for Pascal ABC 2 numbers are entered from the keyboard, if they are both even

Program for Pascal ABC 2 numbers are entered from the keyboard, if they are both even, then find their difference, otherwise calculate the sum of the modules.

Program proverka_chetnosty;
var a, b, rez: integer; /// Introduced integer variables: two numbers and a result
begin
writeln (‘Enter two numbers’); /// The message is displayed on the screen
readln (a, b); /// The program assigned the entered numbers to the variables a and b
begin
if (a mod 2 = 0) and (b mod 2 = 0) then /// If both numbers are even, then
rez: = abs (b – a) /// the result will be the modulus of their difference
else rez: = abs (a) + abs (b); /// otherwise the result will be the sum of their modules
end;
writeln (rez); /// Display the result on the screen
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.