Saturday 29 June 2013

Fibonacci series in php

<html>
<head>
<title></title>
</head>
<body>
<?php
function fib($a=0,$b=1,$i=1)
{
do
{
$c=$a+$b;
echo $c;
print "<br/>";
$i++;
$a=$b;
$b=$c;
}while($i<=10);
}
fib();
?>
</body>
</html>

No comments:

Post a Comment