First 9 prime Fibonacci number: Difference between revisions

Added Algol 68
(Realize in F#)
(Added Algol 68)
Line 3:
;Task:
<br>Show on this page the first 9 prime Fibonacci numbers.
 
=={{header|ALGOL 68}}==
{{libheader|ALGOL 68-primes}}
<lang algol68>BEGIN # show the first 9 prime fibonacci numbers #
PR read "primes.incl.a68" PR # include prime utilities #
INT p count := 0;
INT prev := 0;
INT curr := 1;
WHILE p count < 9 DO
INT next = prev + curr;
prev := curr;
curr := next;
IF is probably prime( curr ) THEN
# have a prime fibonacci number #
p count +:= 1;
print( ( " ", whole( curr, 0 ) ) )
FI
OD
END</lang>
{{out}}
<pre>
2 3 5 13 89 233 1597 28657 514229
</pre>
 
=={{header|C}}==
3,048

edits