<?php
$klub = array ("Persik Kediri", "Persebaya Surabaya", "PSIS Semarang", "Persipura Jayapura");
print "Klub-klub yang pernah juara Liga Indonesia :<br>";
foreach ($klub as $nilai)
{
print "$nilai <br>";
}
?>
<?php
for ($i = 1; $i <= 5; $i++) { print $i ."<br> "; } $bila = 5; $pola = 1; print " <br> Bilangan ganjil antara 5 sampai 25 <br>";
for ($pola=1; $pola<10; style="font-weight: bold;">Foreach
<?php
$nilai1=32;
$nilai2=8;
$jumlah=$nilai1+$nilai2;
$kurang=$nilai1-$nilai2;
$kali=$nilai1*$nilai2;
$bagi=$nilai1/$nilai2;
$sisa=$nilai1%$nilai2;
print "Contoh operasi Aritmatika <br>";
print "Nilai \$nilai1=$nilai1 dan \$nilai2=$nilai2 <br><br>";
print "\$nilai1 + \$nilai2 = $jumlah <br>";
print "\$nilai1 - \$nilai2 = $kurang <br>";
print "\$nilai1 * \$nilai2 = $kali <:br>"; print "\$nilai1 / \$nilai2 = $bagi <br>"; print "\$nilai1 % \$nilai2 = $sisa <br>"; ?>
Copyright 2010 FaDiLah
Theme designed by Lorelei Web Design
Blogger Templates by Blogger Template Place | supported by One-4-All
0 komentar:
Posting Komentar