Palindromic primes: Difference between revisions

add FreeBASIC
(add FreeBASIC)
Line 130:
929
</pre>
 
=={{header|FreeBASIC}}==
<lang freebasic>#include "isprime.bas"
 
function is_pal( s as string ) as boolean
dim as integer i, n = len(s)
for i = 1 to n\2
if mid(s,i,1)<>mid(s,n-i+1,1) then return false
next i
return true
end function
 
for i as uinteger = 2 to 999
if is_pal( str(i) ) andalso isprime(i) then print i;" ";
next i : print</lang>
{{out}}<pre>
2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929</pre>
 
=={{header|Go}}==
781

edits