PHP Pyramid Part XII
<?php $limit = 5; for($i=0;$i<=$limit;$i++) { for($j=$limit;$j>=$i;$j--) { echo " "; } echo "1"; for($x=1;$x<=$i;$x++) { echo "0"; } echo "1"; echo "<br/>"; } ?>
Output: 11 101 1001 10001 100001 1000001
Published · Updated
<?php $limit = 5; for($i=0;$i<=$limit;$i++) { for($j=$limit;$j>=$i;$j--) { echo " "; } echo "1"; for($x=1;$x<=$i;$x++) { echo "0"; } echo "1"; echo "<br/>"; } ?>
Output: 11 101 1001 10001 100001 1000001
by Qualitians · Published October 1, 2016 · Last modified July 23, 2024
by Qualitians · Published October 1, 2016 · Last modified July 23, 2024
by Qualitians · Published October 1, 2016 · Last modified July 23, 2024