irwan

Fibonaccy rule

Mar 17th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. <?php  
  2. $count = 0 ;  
  3. $f1 = 0;  
  4. $f2 = 1;  
  5. echo $f1." , ";  
  6. echo $f2." , ";  
  7. while ($count < 20 )  
  8. {  
  9. $f3 = $f2 + $f1 ;  
  10. echo $f3." , ";  
  11. $f1 = $f2 ;  
  12. $f2 = $f3 ;  
  13. $count = $count + 1;  
  14. }  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment