PHP-Code:
<?php
$preis="100000";
$a="20";
$multi="0.1";
for($n=1; $n < $a; $n++)
{
if($n==1)
{
$z = ($preis*$multi)+$preis;
$erg = $preis+$z;
echo $z." - ";
echo $erg."<br>";
round($z,0);
round($erg,-3);
}
else
{
$z = ($z*$multi)+$z;
$erg = $z+$erg;
echo $z." - ";
echo $erg."<br>";
round($z,0);
round($erg,-3);
}
}
echo "<br />Ergebnis: ".$erg;
?>
Kommentar