your image

PHP Table of Number Program - javatpoint

javapoint
Related Topic
:- PHP Java

Table of Number

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.

Example:

We'll print the table of 7.

 

Difference between JDK, JRE, and JVM

  1. <?php    
  2. define('a', 7);   
  3. for($i=1; $i<=10; $i++)   
  4. {   
  5.   echo $i*a;   
  6.   echo '<br>';     
  7. }  
  8. ?>  

Output:

Comments