program Average; var a, b, sum, count, average: Integer; begin sum := 0; count := 0; Write('Enter the starting point (a): '); Readln(a); Write('Enter the ending point (b): '); Readln(b); for i := a to b do begin sum := sum + i; count := count + 1; end; average := sum / count; WriteLn('The average of numbers from ', a, ' to ', b, ' is: ', average); end.
var
a, b, sum, count, average: Integer;
begin
sum := 0;
count := 0;
Write('Enter the starting point (a): ');
Readln(a);
Write('Enter the ending point (b): ');
Readln(b);
for i := a to b do
begin
sum := sum + i;
count := count + 1;
end;
average := sum / count;
WriteLn('The average of numbers from ', a, ' to ', b, ' is: ', average);
end.