Double Twin Primes: Difference between revisions

Double Twin Primes in FreeBASIC
(Added XPL0 example.)
(Double Twin Primes in FreeBASIC)
Line 13:
Find and show here all Double Twin Primes under 1000.
<br>
 
=={{header|FreeBASIC}}==
<syntaxhighlight lang="vb">#include "isprime.bas"
 
Dim As Uinteger num = 3
Do
If isPrime(num) Then
If isPrime(num+2) Then
If isPrime(num+6) Then
If isPrime(num+8) Then Print num; " "; num+2; " "; num+6; " "; num+8
End If
End If
End If
num += 2
Loop Until num >= 1000-8
 
Sleep</syntaxhighlight>
{{out}}
<pre>5 7 11 13
11 13 17 19
101 103 107 109
191 193 197 199
821 823 827 829</pre>
 
=={{header|Raku}}==
Cousin twin primes:
2,122

edits