$a = $_POST[txtawal];
$c = $_POST[txtakhir];
$p="prima_prima";
$b="bukan prima";
for($a==1;$a<=$c;$a++)
{
if($a == 1) echo $a." ".$b."
";
elseif(($a==2)($a==3)($a==5)($a==7)) echo $a." ".$p."
";
else cek($a);
}
function cek()
{
global $a,$b,$p;
if(($a%2==0)($a%3==0)($a%5==0)($a%7==0)) echo $a." ".$b."
";
else echo $a." ".$p."
";
}
Jumat, Februari 27, 2009
Langganan:
Posting Komentar (Atom)
tanks gan... by iso
BalasHapus