program PascalArray;
varA: array [1..7] of integer;B: array [1..7] of integer;i, j: integer;
beginrandomize;
for i := 1 to 7 dobeginA[i] := random(21) - 10;writeln('A[', i, '] = ', A[i]);end;
j := 1;
for i := 1 to 7 dobeginif (A[i] < 0) and (A[i] mod 2 = 0) thenbeginB[j] := A[i];j := j + 1;end;end;
writeln('Array B:');
for i := 1 to j - 1 dobeginwriteln('B[', i, '] = ', B[i]);end;end.
program PascalArray;
var
A: array [1..7] of integer;
B: array [1..7] of integer;
i, j: integer;
begin
randomize;
for i := 1 to 7 do
begin
A[i] := random(21) - 10;
writeln('A[', i, '] = ', A[i]);
end;
j := 1;
for i := 1 to 7 do
begin
if (A[i] < 0) and (A[i] mod 2 = 0) then
begin
B[j] := A[i];
j := j + 1;
end;
end;
writeln('Array B:');
for i := 1 to j - 1 do
begin
writeln('B[', i, '] = ', B[i]);
end;
end.