Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
dvprog_13 [2017-09-01 14:54]
127.0.0.1 external edit
dvprog_13 [2019-09-09 09:25]
Daniel Viström
Line 10: Line 10:
  * Rekursiv funktion som beräknar värdet av den rekursiva  * Rekursiv funktion som beräknar värdet av den rekursiva
  * talföljden där a(1) = 5 och a(n+1)=a(n)+4.  * talföljden där a(1) = 5 och a(n+1)=a(n)+4.
 + *
 + * Denna talföljd kan även beskrivas med a(1) = 5 och a(n)=a(n-1)+4, 
 + * vilket vi använder oss av när vi kodar den.
  */  */
 function a($n){ function a($n){
Line 24: Line 27:
 } }
  
-include('head.php');+include 'head.php';
 echo 'a4 = ' . a(4) . '<br>'; echo 'a4 = ' . a(4) . '<br>';
 echo 'a5 = ' . a(5) . '<br>'; echo 'a5 = ' . a(5) . '<br>';
-include('foot.php');+include 'foot.php';
  
 </code> </code>
Line 53: Line 56:
  
  
-include('head.php');+include 'head.php';
  
 $name = 'Ulla'; $name = 'Ulla';
Line 61: Line 64:
 namnutskrift($name, $n); namnutskrift($name, $n);
    
-include('foot.php');+include 'foot.php';
  
 </code> </code>