<form method="post">
<input type="text" nama='nilai' placeholder="masukkan bilangan"><br>
<input type="submit" value="hitung">
</form>
<br>
<?php
$nilai=$_POST['nilai'];
echo "Bilangan Genap : <br>";
for ($i=1;$i<=$nilai;$i++){
if ($i%2==0){
echo $i." ";
}
}
echo "<br>Bilangan Ganjil : <br>";
for ($i=1;$i<=$nilai;$i++){
if ($i%2==1){
echo $i." ";
}
}?>
EmoticonEmoticon