quick links

Write program fibonacci series

A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.

<?php
echo $a = 0;
echo "  ";
echo $b = 1;
echo "  ";
for($i=0; $i<=15; $i++) {
echo $j = $a+$b; echo "  ";
$a = $b;
$b = $j;
}
?>

OUTPUT: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597

 

About Us

Joomla Web Solution

We love working with PHP, HTML5, CSS3, jQuery and the most-loved content management framework in the world, Joomla!

LIKE US ON FACEBOOK