DeveloperBreeze

Generate the Fibonacci series

$n = 10;
$a = 0;
$b = 1;
echo $a . ' ' . $b . ' ';
for ($i = 2; $i < $n; $i++) {
    $c = $a + $b;
    echo $c . ' ';
    $a = $b;
    $b = $c;
}

Continue Reading

Handpicked posts just for you — based on your current read.

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!