Pyramid in PHP Part IV

PHP Pyramid Part 4
PHP Pyramid Part 4

<?php
 $limit = 5;
 for($i=0;$i<=$limit;$i++) 
 { 
   for($k=$i;$k>0;$k--)
   {
     echo "*";
   }
   echo "<br/>";
 }
?>
Output:
*
**
***
****
*****

 

You may also like...

Leave a Reply