Primality by trial division: Difference between revisions
Content deleted Content added
Adding MUMPS example |
m →[[Primality by trial division#ALGOL 68]]: fix pre tag |
||
Line 34: | Line 34: | ||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
{{works with|ALGOL 68|Revision 1 - no extensions to language used}} |
|||
<lang algol68>main:(</lang> |
|||
{{works with|ALGOL 68G|Any - tested with release [http://sourceforge.net/projects/algol68/files/algol68g/algol68g-1.18.0/algol68g-1.18.0-9h.tiny.el5.centos.fc11.i386.rpm/download 1.18.0-9h.tiny]}} |
|||
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d] - due to extensive use of FORMATted transput}} |
|||
{{prelude/is_prime.a68}}; |
{{prelude/is_prime.a68}}; |
||
<lang algol68> |
<lang algol68>main:( |
||
INT upb=100; |
|||
printf(($" The primes up to "g(-3)" are:"l$,upb)); |
printf(($" The primes up to "g(-3)" are:"l$,upb)); |
||
FOR i TO upb DO |
FOR i TO upb DO |
||
Line 48: | Line 51: | ||
)</lang> |
)</lang> |
||
Output: |
Output: |
||
<pre> |
|||
The primes up to 100 are: |
|||
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 |
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 |
||
</pre> |
|||
=={{Header|AutoHotkey}}== |
=={{Header|AutoHotkey}}== |