In the code below, I used the while loop but you can achieve it using for loop and even do while loop.
Try Multiplication Table in PHP here! Live!
PHP Code Multiplication Table
<?php
$num=9;
$i=1;
while ($i<=10)
{
$total=$num*$i;
echo $num." * ".$i." = ".$total."<br>";
$i++;
}
?>
Output Multiplication Table
Thank you for visiting and hope this helps you. Feel free to leave a comment below for any questions. I got some other articles related to php and mysql here in my blog. Watch out for more upcoming tutorials related to blogging and programming. Good day! ^_^
No comments:
Post a Comment