Q:

Table of Number in Php

0

A table of a number can be printed using a loop in program.

Logic:

  • Define the number.
  • Run for loop.
  • Multiply the number with for loop output.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Example:

We'll print the table of 7.

<?php    
define('a', 7);   
for($i=1; $i<=10; $i++)   
{   
  echo $i*a;   
  echo '<br>';     
}  
?>  

Output:

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now