Laman

Sunday, 7 April 2013

CONTOH SCRIPT PHP 'PERULANGAN'

<?php

echo 'TUGAS PEMROGRAMAN KOMPUTER';

$N0=100;
$T=100;
$t=200;

$N=$N0*pow(0.5,$t/$T);

echo 'Diketahui :';
echo '<br/>';
echo 'N0 = ';
echo $N0;
echo '<br/>' ;
echo 'T = ';
echo $T;
echo '<br/>';
echo 't = ';
echo $t;
echo '<br/>';
echo 'Ditanya :';
echo '<br/>';
echo 'N ?';
echo '<br/>';
echo 'Jawab :';
echo '<br/>';
echo 'N = N0 (1/2) <sup> t/T <sub> 1/2 </sub> </sup>';
echo '<br/>';
ECHO 'N = ';
echo $N;

?>