Write a complete PHP enabled website using WebMatrix or otlier Web server IDE. I
ID: 3695276 • Letter: W
Question
Write a complete PHP enabled website using WebMatrix or otlier Web server IDE. In the major php file of this site. i.e. index.php if you use WebMatrix. inside PHP script block, write PHP code to print out first 20 number in the Fibonacci series starting with 1 and 1. The details about Fibonacci series can be found at following Wikipedia page. Print these numbers in one line. You need use PHP output statement, flow control statements for selection and loop control structure. In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence:[1][2] 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,... Make sure the php file still have all necessary HTML tag as a complete and functional HTML file.Explanation / Answer
PHP code to print fibnocci series in one line as you asked:
<?php
$count=0;
$f1=1;
$f2=1;
echo $f1." , ";
echo $f2." , ";
while ($count<20)
{
$f3 + $f1 + F2;
echo $f3. , ";
$f1 = $f2;
$f2 = $f3;
$count = $count + 1;
}
?>
Its output will be like1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ............
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.