phpedu
Sunday, 26 May 2013
php progarm to fibonacci series
php progarm to print fibonacci series
CODE :
<?php
$n=10;//n-th Fibonacci number
for($a=1,$b=1,$c=0,$i=0;$i<$n;$i++)
{
$c=$a+$b;
if ($i==0) echo $a.' '.$b.' ';
$a=$b;
$b=$c;
echo $c.' ';
}
?>
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment