Program Average; var arr: array[1..10] of integer; sum, count: integer; i: integer;
begin sum := 0; count := 0;
writeln('Enter 10 integers:'); for i := 1 to 10 do begin readln(arr[i]); if (i mod 2 <> 0) and (arr[i] mod 2 = 0) then begin sum := sum + arr[i]; count := count + 1; end; end;
if count > 0 then writeln('Average of even elements on odd positions: ', sum / count) else writeln('No even elements on odd positions'); end.
Program Average;
var
arr: array[1..10] of integer;
sum, count: integer;
i: integer;
begin
sum := 0;
count := 0;
writeln('Enter 10 integers:');
for i := 1 to 10 do
begin
readln(arr[i]);
if (i mod 2 <> 0) and (arr[i] mod 2 = 0) then
begin
sum := sum + arr[i];
count := count + 1;
end;
end;
if count > 0 then
writeln('Average of even elements on odd positions: ', sum / count)
else
writeln('No even elements on odd positions');
end.