Home » Personal collection » Commodore disks » disk52a2_c16_progs.d64 » prime numbers
prime numbers
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
| Tape/disk: | Home » Personal collection » Commodore disks » disk52a2_c16_progs.d64 | 
| Filename: | prime numbers | 
| Read OK: | ✔ | 
| File size: | 0241 bytes | 
| Load address: | 1001 | 
| Exec address: | 0000 | 
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Commodore disks » disk52a2_c16_progs.d64 » prime numbers
- Personal collection » Commodore tapes » Commodore_16 » drawer_br_tape07a_c16_d90_ages_b.wav » prime numbers
File contents
    10 SCNCLR
    20 INPUT"WHAT NUMBER(5 OR ABOVE)";A%
    25 IF INT(A%/2)=A%/2 THEN 200
    27 IF A%<5 THEN 250
    30 PRINT:PRINT:PRINT:PRINT:PRINT"PLEASE WAIT..."
    40 B=3
    50 IF INT(A%/B)=A%/B THEN 80
    60 IF B>A%/2 THEN 90
    70 B=B+2:GOTO 50
    80 PRINT"<cursor up>              <cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left>";A%;"ISN'T A PRIME NUMBER.":GOTO 100
    90 PRINT"<cursor up>              <cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left><cursor left>";A%;"IS A PRIME NUMBER."
   100 PRINT:PRINT:PRINT"DO YOU WANT TO TEST ANOTHER NUMBER(Y/N)?"
   110 GETKEY A$:IF A$="Y" THEN GOTO 10
   120 IF A$="N" THEN SCNCLR:END
   130 GOTO 110
   200 PRINT:PRINT:PRINT:PRINT:PRINT"ODD NUMBERS ONLY PLEASE!"
   210 PRINT:PRINT"PRESS ANY KEY."
   220 GETKEY A$
   230 GOTO 10
   250 PRINT:PRINT:PRINT:PRINT:PRINT"5 OR ABOVE PLEASE!"
   260 PRINT:PRINT"PRESS ANY KEY."
   270 GETKEY A$
   280 GOTO 10
                � ) �"WHAT NUMBER(5 OR ABOVE)";A% B � �(A%�2)�A%�2 � 200 S � A%�5 � 250 q �:�:�:�:�"PLEASE WAIT..."