Pyramid in PHP Part II

PHP Pyramid Part II
PHP Pyramid Part II

<?php
 $limit = 5;
 for($i=0;$i<=$limit;$i++)
 {
   for($k=1;$k<=$i;$k++)
   {
     echo $k;
   }
   echo "<br/>";
 }
?>
Output:
1
12
123
1234
12345

 

You may also like...

Leave a Reply