PHP Pyramid Part XII

PHP Pyramid Part 12
PHP Pyramid Part 12

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

 

Qualitians

Welcome to Qualitians, your premier destination for world-class content on information security, data privacy, cybersecurity, and security operations. Since 2015, we've been committed to delivering high-quality resources to students, professionals, and enthusiasts worldwide. Trusted by a diverse readership, including CISOs, IT executives, government leaders, and service providers, Qualitians offers detailed guides, industry updates, expert insights, case studies, and practical toolkits. Our mission is to empower our community to stay ahead of cybersecurity challenges with balanced, thorough, and practical insights. Stay informed. Stay secure. Trust Qualitians.

You may also like...