home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
239.img
/
TPROF10.ZIP
/
TFEXMPL3.ZIP
/
PRIME3PA.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-05-07
|
509b
|
32 lines
{ Copyright (c) 1990, Borland International }
program Prime3PA;
Var
I,N: Integer;
Function Root( N : Integer ): Integer;
Begin
Root := Trunc(Sqrt( N ));
End;
Function Prime( N : Integer ):Boolean;
Var
I, Limit : integer;
Begin
Limit := Root(N);
For I := 2 to Limit do
If (N MOD I = 0) then
Begin
Prime := False;
Exit;
End;
Prime := True;
End;
Begin
N := 1000;
For I := 2 to N do
If Prime(I) then
Writeln( I );
End.