Jump to content

Piprimes: Difference between revisions

add tinybasic
(add parigp)
(add tinybasic)
Line 216:
done...
</pre>
 
=={{header|TinyBASIC}}==
<lang tinybasic> LET N = 0
LET P = 0
10 IF N = 22 THEN END
PRINT N
LET P = P + 1
GOSUB 100
20 IF Z = 1 THEN LET N = N + 1
GOTO 10
100 REM PRIMALITY BY TRIAL DIVISION
LET Z = 1
LET I = 2
110 IF (P/I)*I = P THEN LET Z = 0
IF Z = 0 THEN RETURN
LET I = I + 1
IF I*I < P THEN GOTO 110
RETURN</lang>
 
=={{header|Wren}}==
781

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.