program AddFourDigitNumbers;varnum1, num2: integer;beginwriteln('Enter the first four-digit number: ');readln(num1);
while (num1 < 1000) or (num1 > 9999) dobeginwriteln('Please enter a valid four-digit number: ');readln(num1);end;
writeln('Enter the second four-digit number: ');readln(num2);
while (num2 < 1000) or (num2 > 9999) dobeginwriteln('Please enter a valid four-digit number: ');readln(num2);end;
writeln('The sum of the two four-digit numbers is: ', (num1 + num2));end.
program AddFourDigitNumbers;
var
num1, num2: integer;
begin
writeln('Enter the first four-digit number: ');
readln(num1);
while (num1 < 1000) or (num1 > 9999) do
begin
writeln('Please enter a valid four-digit number: ');
readln(num1);
end;
writeln('Enter the second four-digit number: ');
readln(num2);
while (num2 < 1000) or (num2 > 9999) do
begin
writeln('Please enter a valid four-digit number: ');
readln(num2);
end;
writeln('The sum of the two four-digit numbers is: ', (num1 + num2));
end.