program DeleteMultiples; const n = 10; var arr: array[1..n] of integer; i, j: integer; begin for i := 1 to n do begin write('Enter element ', i, ': '); readln(arr[i]); end;
writeln('Array before deleting:'); for i := 1 to n do write(arr[i], ' ');
j := 0; for i := 1 to n do begin if (arr[i] mod 3 <> 0) and (arr[i] mod 5 <> 0) then begin j := j + 1; arr[j] := arr[i]; end; end;
writeln; writeln('Array after deleting:'); for i := 1 to j do write(arr[i], ' '); end.
program DeleteMultiples;
const
n = 10;
var
arr: array[1..n] of integer;
i, j: integer;
begin
for i := 1 to n do
begin
write('Enter element ', i, ': ');
readln(arr[i]);
end;
writeln('Array before deleting:');
for i := 1 to n do
write(arr[i], ' ');
j := 0;
for i := 1 to n do
begin
if (arr[i] mod 3 <> 0) and (arr[i] mod 5 <> 0) then
begin
j := j + 1;
arr[j] := arr[i];
end;
end;
writeln;
writeln('Array after deleting:');
for i := 1 to j do
write(arr[i], ' ');
end.