Var ar:array[1..12] of integer; ar2:array[1..12] of integer; i,k:integer; begin; randomize; writeln('Array:'); for i:=1 to 12 do begin; ar[i]:=random(30); write(ar[i]:4); if ar[i] mod 2=0 then begin; inc(k); ar2[k]:=i; end; end; writeln; writeln('Final array:'); for i:=1 to k do write(ar2[i]:4); end.
ar2:array[1..12] of integer;
i,k:integer;
begin;
randomize;
writeln('Array:');
for i:=1 to 12 do
begin;
ar[i]:=random(30);
write(ar[i]:4);
if ar[i] mod 2=0 then
begin;
inc(k);
ar2[k]:=i;
end;
end;
writeln;
writeln('Final array:');
for i:=1 to k do
write(ar2[i]:4);
end.