Thursday, March 21, 2019

DDP 4

ddp4a.php
<html>
<body>
<?php
$x=4;
switch ($x)
{
case 1:
echo "Nomor 1";
break;
case 2:
echo "Nomor 2";
break;
case 3:
echo "Nomor 3";
break;
default:
echo "Angka yang dimasukkan bukan 1, 2 ataupun  3";
}
?>
</body>
</html>

**
ddp4b.php
<html>
<body>
<?php
for ($i=3; $i<=10; $i++)
{
echo "Bilangan ke-$i: " . $i . "<br />";
}
?>
</body>
</html>

**
ddp4c.php
<html>
<body>
<?php
for ($i=1;; $i++)
{
echo "Angkanya adalah " . $i . "<br />";
if ($i>=5) exit;
}
?>
</body>
</html>

**
ddp4e.php
<html>
<body>
<?php
$x=array("satu","dua","tiga");
foreach ($x as $value)
{
echo $value . "<br />";
}
?>
</body>
</html>

**
ddp4f.php
<html>
<body>
<?php
$i=1;
while($i<=9)
{
echo "Bilangan ke-$i: " . $i . "<br />";
$i++;
}
//halaman 27
?>
</body>
</html>

**
ddp4g.php
<html>
<body>
<?php
$i=1;
do
{
$i++;
echo "Bilangan ke-$i: " . $i . "<br />";
}
while ($i<=5);
?>
</body>
</html>


Bitcoin Offers:
Free Bitcoin, Double Bitcoin, Bitcoin Investment, Bitcoin Trading



"Bitcoin and Forex are high risk business. We must join them smartly."

No comments:

Post a Comment