Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Fibonacci Series Program. in php

<?php
// Fibonacci Series
// using Recursion
 
// function returns
// the Fibonacci number
function fib($n)
{
    if ($n <= 1)
        return $n;
    return fib($n - 1) +
           fib($n - 2);
}
 
// Driver Code
$n = 9;
echo fib($n);
 

?>
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Fibonacci #Series #php
ADD COMMENT
Topic
Name
6+7 =