Primality by trial division: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add Modula-2) |
Not a robot (talk | contribs) m (→{{header|Modula-2}}: beginning) |
||
Line 3,113: | Line 3,113: | ||
=={{header|Modula-2}}== |
=={{header|Modula-2}}== |
||
<syntaxhighlight lang="modula2"> |
<syntaxhighlight lang="modula2">MODULE TrialDivision; |
||
FROM InOut IMPORT WriteCard, WriteLn; |
|||
CONST |
|||
Max = 100; |
|||
VAR |
|||
i: CARDINAL; |
|||
PROCEDURE prime(n: CARDINAL): BOOLEAN; |
|||
VAR |
VAR |
||
factor: CARDINAL; |
factor: CARDINAL; |