//sandr's werk <p> trololol </p> <?php function priem($num) { if ($num % 2 != 0 && $num % 3 != 0 && $num % 5 != 0 && $num % 7 != 0 && $num != 1 || $num == 2 || $num == 3 || $num == 5 || $num == 7) { echo $num . " is een getal<br>"; } } for ($i = 1; $i <= 10000; $i++) { priem($i); }
return sqrt($num1); } } if (isset($_POST['btn'])) { $getal1 = $_POST['getal1']; $getal2 = $_POST['getal2']; echo bereken($getal1, $getal2); } ?> <h3>Opdracht 6</h3> <?php function priem($n) { for ($i = 1; $i <= $n; $i++) { $counter = 0; for ($j = 1; $j <= $i; $j++) { if ($i % $j == 0) { $counter++; } } if ($counter == 2) { print $i . " is een priemgetal <br/>"; } } } priem(400); ?> </div> </body> </html>