I want to read all prime numbers between 1 and 10000 into a dynamic array and all non-prime numbers into another dynamic array and then read the prime array into riche
procedure TForm1.btnprimeClick(Sender: TObject);
var K, I, iCount : Integer;
begin
for K := iStart to iEnd do
begin
iCount := 0;
for I := 2 to iEnd do
begin
if K mod I = 0 then
begin
Inc(iCount);
end;
end;
if iCount = 1 then
begin
memData.Lines.Add(IntToStr(K));
end;
end;
end;