Advertisement
theloserboy

Deret Fibonacci

Nov 11th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <html>
  2. <head><title> Coba PHP </title></head>
  3. <body>
  4. <?php
  5.  
  6. $a;
  7. $n=16;
  8. $f=1;
  9. $f2=1;
  10. $fibo;
  11.  
  12. echo "<br>Deret Fibonacci -> 1 ";
  13. for($a=1;$a<=$n-2;$a++)
  14. {
  15. echo "$f2 &nbsp;";
  16. $fibo=$f+$f2;
  17. $f = $f2;
  18. $f2 = $fibo;
  19. }
  20. echo"$fibo &nbsp;";
  21.  
  22. ?>
  23. </body>
  24. </html>
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement