Pyramid in PHP Part VI

PHP Pyramid Part 6
PHP Pyramid Part 6

<?php
 $limit = 5;
 for($i=0;$i<=$limit;$i++)
 {
   echo "1";
   for($x=1;$x<=$i;$x++)
   {
     echo "0";
   }
   echo "1";
   echo "<br/>";
 }
?>
Output:
11
101
1001
10001
100001
1000001

 

You may also like...

Leave a Reply