Write a PHP program to print out the multiplication table upto 5*5


Introduction

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. <?php
  2. for ($i = 1; $i < 6; $i++) {
  3. for ($j = 1; $j < 6; $j++) {
  4. if ($j == 1) {
  5. echo str_pad($i*$j, 3, " ", STR_PAD_LEFT);
  6. } else {
  7. echo str_pad($i*$j, 3, " ", STR_PAD_LEFT);
  8. }
  9. }
  10. echo "<br>";
  11. }
  12. ?>

Result

python language techstudy.org

     





Related Topics




Popular Posts