Var ar:array[1..15] of integer; i:integer; begin; randomize; writeln('Array:'); for i:=1 to 15 do begin; ar[i]:=random(9); write(ar[i]:4); if ar[i] mod 2=0 then ar[i]:=ar[i]+1 else ar[i]:=ar[i]*2; end; writeln; writeln('Final array:'); for i:=1 to 15 do write(ar[i]:4); end.
Answers & Comments
Verified answer
Var ar:array[1..15] of integer;i:integer;
begin;
randomize;
writeln('Array:');
for i:=1 to 15 do
begin;
ar[i]:=random(9);
write(ar[i]:4);
if ar[i] mod 2=0 then ar[i]:=ar[i]+1 else ar[i]:=ar[i]*2;
end;
writeln;
writeln('Final array:');
for i:=1 to 15 do
write(ar[i]:4);
end.