PHP Compiler
<!DOCTYPE html> <html> <body> <?php $limit = 100; $a = 0; $b = 1; $c = 0; echo "Fibonacci series upto $limit: <br>"; echo "$a, $b"; while($c <= $limit) { $c = $a + $b; $a = $b; $b = $c; if($c <= $limit) echo ", $c"; } ?> </body> </html>
OUTPUT
Fibonacci series upto 100:
0 1 1 2 3 5 8 13 21 34 55 89
×

Save as Private