Count by m

<?php
/*
 * Created on Feb 11, 2008
 *
 * Homework problem:
 * Write a PHP script that contains a for loop that prints the values from 0 to n
 * that are divisible by m. For example if n is 20 and m is 3, then your loop should print:
 * 0, 3, 6, 9, 12, 15, 18. If m were 5, it should print 0, 5, 10, 15, 20.
 */
?>
<HTML>
  <HEAD>
    <TITLE>Math Example</TITLE>
  </HEAD>
  <BODY>
    <H4>Counting to 100 by M</h4>
    <?php
       $m = rand(2,10);	     //	Pick a random divisor
       echo "Choosing random divisor $m<br>";
       $n = 100;             // Loop Initializer
       for ($k = 0; $k <= $n; $k += $m) {
      	  echo "$k<BR>";
       }
       echo "Done<BR>";
    ?>
  </BODY>
</HTML>