program SumOrDifference;
varnum1, num2, result: integer;
beginwriteln('Enter the first number: ');readln(num1);
writeln('Enter the second number: ');readln(num2);
if (num1 mod 2 = 0) and (num2 mod 2 = 0) thenresult := num1 - num2elseresult := abs(num1) + abs(num2);
writeln('Result: ', result);end.
program SumOrDifference;
var
num1, num2, result: integer;
begin
writeln('Enter the first number: ');
readln(num1);
writeln('Enter the second number: ');
readln(num2);
if (num1 mod 2 = 0) and (num2 mod 2 = 0) then
result := num1 - num2
else
result := abs(num1) + abs(num2);
writeln('Result: ', result);
end.