Login Register






PHP Fibonacci filter_list
Author
Message
PHP Fibonacci #1
Last weak ,My friend is call me to challenge about the fibonacci:Frown:
he is C# developer :Thumbs-Up:
but i will solve with php because i am php web develper :Sarcastic:

Here is my Answer with Prof:Innocent:
[Image: 2ca7n5.png]

Source code
Code:
<html> <head><title>Fibonacci Challenge</title><head> <body> <form action="" method="post"> <input type="text" name="name"/> <br> <input type="submit" value="enter"/> </form> </body> </html> <?php $first = 0; $second = 1; $n =$_POST['name']; print 'Your input number is = '. $n . '<br/>'; print 'Fibonacci numbers is = '. $first.','; for($i=1;$i<=$n-1;$i++) { $final = $first + $second; $first = $second; $second = $final; print $final . ','; } ?>
[Image: 946696_301886219956429_1080285596_n.jpg]

ေမေမနဲ႔မီးငယ္နွစ္ေယာက္လံုးကိုအရမ္းခ်စ္တယ္

Reply