Jump to content

10001th prime: Difference between revisions

Added Gambas
(Added Chipmunk Basic and True BASIC)
(Added Gambas)
Line 147:
</syntaxhighlight>
{{out}}<pre>104743</pre>
 
==={{header|Gambas}}===
<syntaxhighlight lang="vbnet">'Use "isprime.bas"
 
Public Sub Main()
 
Print prime(10001)
End
 
Function prime(n As Integer) As Long
 
If n = 1 Then Return 2
Dim p As Integer = 3, pn As Integer = 1
While pn < n
If isPrime(p) Then pn += 1
p += 2
Wend
Return p - 2
End Function </syntaxhighlight>
{{out}}
<pre>104743</pre>
 
==={{header|GW-BASIC}}===
2,169

edits

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