Tuesday, 30 March 2021

1,2,4,7,11,16...n series in php step by step

 1,2,4,7,11,16...n in PHP



<?php

/* 1,2,4,7,11,16...n. */

$l=1;

$a=1;

$b=1;

while($l<=10)

{

print"<br>".$a;

$a=$b+$a;

$b++;

$l++;

}

?>


 


No comments:

Post a Comment