Skip to content

Commit

Permalink
Add Fibonacci Series in PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
leofls committed Oct 4, 2018
1 parent 12999f7 commit e8d1c40
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,4 +625,9 @@ Programming Languages: JavaScript, C++, Haskell, Scala, Python, Ruby
Name: [Shreyansh Kulshreshtha](http://github.com/shreyanshkuls)<br />
Place: Mandi, Himachal Pradesh, India<br />
About: Undergraduate student, Music enthusiast, like programming<br />
Programming Languages: C, C++<br />
Programming Languages: C, C++<br />

Name: [Leandro Ferreira](https://github.com/leofls)<br />
Place: Maceió, Alagoas Pradesh, Brazil<br />
About: robotics teacher, programming student<br />
Programming Languages: PHP, C++, Java, Python<br />
20 changes: 20 additions & 0 deletions fibonacci/fibonacci.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
function Fibonacci($n){

$num1 = 0;
$num2 = 1;

$counter = 0;
while ($counter < $n){
echo ' '.$num1;
$num3 = $num2 + $num1;
$num1 = $num2;
$num2 = $num3;
$counter = $counter + 1;
}
}


$n = 10;
Fibonacci($n);
?>

0 comments on commit e8d1c40

Please sign in to comment.