program Project1;
uses
SysUtils;
var realnum1, realnum2, sum:real;
dp:integer;
begin
writeln('Enter a real number');
readln(realnum1);
writeln('Enter a second real number');
readln(realnum2);
repeat
writeln('Enter the number of decimal places: must be even');
readln(dp);
if odd(dp) then writeln('Number of decimal places must be odd');
until not odd(dp);
writeln('Sum:',realnum1+realnum2:10:dp);
readln;
end.
We use the repeat..until construct to request a number until we get the correct form. We use the pre-defined odd(integer) function to check whether the input number is odd. We repeat the input until the value is NOT odd, that is, even. We use if..then to check the user input and output a message if the number is odd. We use the comma separator in the writeln statements to output a sentence containing the values of the variables and pieces of literal string.