Print Table of any Number In PHP

📔 : PHP 🔗
Copy Fullscreen Close Fullscreen
<?php
  /*define a function ti print a table. 
  *@param $number:int.
  */
  function print_table($number)
  {
    echo "Table of $number : <br/>";
    for($i=1 ; $i<=10 ; $i++)
    {
      echo $i*$number."<br/>";
    }
  }

  /*now try to print a table*/
  print_table(10);
  print_table(14);
?>
Output
Table of 10 :
10
20
30
40
50
60
70
80
90
100
Table of 14 :
14
28
42
56
70
84
98
112
126
140

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook