Fibonacci Series:

The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... The next number is found by adding up the two numbers before it.
Program in PHP:

$a = 1; $b=0; $series = 0;
   for($i=0;$i<=7;$i++)
{
    echo $series;
    $series =$a+$b;
    $a = $b;
    $b = $series;
}

No comments:

Post a Comment