Show sourcecode
The following files exists in this folder. Click to view.
index.php
ovn_gr1.php
ovn_gr2.php
ovn_gr3for.php
ovn_gr3while.php
ovn_gr4.php
ovn_gr5.php
ovn_gr6.php
ovn_gr7.php
ovn_gr6.php
33 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>grunder 6</title>
</head>
<body>
</body>
</html><?php
$antal = 0;
for ($tal = 2; $tal <= 100; $tal++) {
$primtal = true;
for ($i = 2; $i < $tal; $i++) {
if ($tal % $i == 0) {
$primtal = false;
break;
}
}
if ($primtal) {
echo $tal . "<br>";
$antal++;
}
}
echo "Antal primtal: " . $antal;
?>