Tos Web Developer provides insights, tutorials, and advice around topics including content strategy, design, Drupal Development, Drupal Custom Module Development, Drupal 8 Custom themes, PHP, Server, Twig, and more

                           

Print the multiplication table using the PHP program let see how to print multiplication using nested for loop.
         

 <table border="1">  
  <?php  
 /**  
 * using nested for loop print mutiplication table   
 */  
 for ($i = 1;$i < 11;$i++)  
 {  
   echo '<tr>';  
   for ($j = 1;$j < 11;$j++)  
   {  
     echo '<td>' . $i * $j . '</td>';  
   }  
   echo '</tr>';  
 }  
 ?>  
 </table>  


OUTPUT:-

12345678910
2468101214161820
36912151821242730
481216202428323640
5101520253035404550
6121824303642485460
7142128354249566370
8162432404856647280
9182736455463728190
102030405060708090100

No comments:

Post a Comment

| Designed And Blog Post by www.toswebdeveloper.com