Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/ovning1/

index.html
ovn_gr1.php
ovn_gr2.php
ovn_gr3a.php
ovn_gr3b.php
ovn_gr4.php
ovn_gr5.php
ovn_gr6.php
ovn_gr7.php

ovn_gr7.php

25 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html>
<body>

<?php
$primtalcount 
0;
$i 2;
while (
$primtalcount <= 100){
  
$primtalsant 0;
  for (
$a $i-1$a 1$a--){
    if (
$i $a == 0){
      
$primtalsant += 1;
    }
  }
  if (
$primtalsant == 0){
    
$primtalcount += 1;
    echo 
$i"<br>";
  }
  
$i++;
}
?> 

</body>
</html>