Wednesday, 3 January 2018

Print Table of numbers without Loop

<?php

function table($num, $i) {
    if ($i > 10) {
        return false ;
    }
    else {
        echo $num * $i ;
        echo "<br/>" ;
        table($num, ++$i) ;
    }
}
table(5, 1) ;
?>