program Average; var i, sum, count: integer; average: real; begin sum := 0; count := 0; for i := 250 to 500 do begin if (i mod 5 = 0) and (i mod 7 = 0) then begin sum := sum + i; count := count + 1; end; end; if count > 0 then average := sum / count else average := 0; writeln('Average of numbers from 250 to 500, divisible by 5 and 7 simultaneously: ', average:0:2); end.
program Average;
var
i, sum, count: integer;
average: real;
begin
sum := 0;
count := 0;
for i := 250 to 500 do
begin
if (i mod 5 = 0) and (i mod 7 = 0) then
begin
sum := sum + i;
count := count + 1;
end;
end;
if count > 0 then
average := sum / count
else
average := 0;
writeln('Average of numbers from 250 to 500, divisible by 5 and 7 simultaneously: ', average:0:2);
end.