Q:

Table of Number in Php

belongs to collection: PHP Programs

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)

Factorial Program in Php... >>
<< Prime Number in php...