Programm Primzahl  Aufruf mit prim( )

prim()
PRGM
ClrIO                             (Bildschirm löschen)
Local z,i
Prompt z                        (Wartet auf Eingabe --> Zuweisung an z)
For i,2,z /2                     (Schleife von i=2 bis z /2)
  i+1 → i                        (i wird um 1 erhöht)
   If mod(z , i)≠0 Then    (mod bildet den Rest der Division von z und i)
     Goto a                      (Sprung zum Label a)
   Else
     Goto b
   EndIf
EndFor
Lbl a
Disp "Primzahl"
Goto c
Lbl b
Disp "Keine Primzahl"
Lbl c